Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 9bba848

Browse files
committed
Optimize the assignment of scopes
1 parent a216cff commit 9bba848

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc.py.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
126126
Returns:
127127
grpc.Channel: A gRPC channel object.
128128
"""
129-
if scopes is None:
130-
scopes = cls.AUTH_SCOPES
129+
scopes = scopes or cls.AUTH_SCOPES
131130
return grpc_helpers.create_channel(
132131
host,
133132
credentials=credentials,

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc_asyncio.py.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ class {{ service.grpc_asyncio_transport_name }}({{ service.name }}Transport):
6161
Returns:
6262
aio.Channel: A gRPC AsyncIO channel object.
6363
"""
64-
if scopes is None:
65-
scopes = cls.AUTH_SCOPES
64+
scopes = scopes or cls.AUTH_SCOPES
6665
return grpc_helpers_async.create_channel(
6766
host,
6867
credentials=credentials,

0 commit comments

Comments
 (0)