Skip to content

Commit e7f6d28

Browse files
ImTotemclaude
andcommitted
fix(authz): use callable(getattr) for gRPC future detection
UnaryUnaryCall doesn't inherit grpc.Future. Check if result attribute is callable instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fce9ccd commit e7f6d28

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/bcsd_api/authz/client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ def _update(operation, res_type: str, res_id: str, relation: str, user_id: str)
4040

4141

4242
def _resolve(call):
43-
from grpc import Future
44-
45-
if isinstance(call, Future):
46-
return call.result()
43+
if callable(getattr(call, "result", None)):
44+
return call.result() # type: ignore[union-attr]
4745
return call
4846

4947

0 commit comments

Comments
 (0)