Skip to content

Commit 60b8acb

Browse files
committed
simplify conditional statement
1 parent 0f3a0e4 commit 60b8acb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

google/api_core/grpc_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def create_channel(
357357
# If `ssl_credentials` is set and `attempt_direct_path` is set to `True`,
358358
# raise ValueError as this is not yet supported.
359359
# See https://github.com/googleapis/python-api-core/issues/590
360-
if ssl_credentials is not None and attempt_direct_path:
360+
if ssl_credentials and attempt_direct_path:
361361
raise ValueError("Using ssl_credentials with Direct Path is not supported")
362362

363363
composite_credentials = _create_composite_credentials(

google/api_core/grpc_helpers_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def create_channel(
277277
# If `ssl_credentials` is set and `attempt_direct_path` is set to `True`,
278278
# raise ValueError as this is not yet supported.
279279
# See https://github.com/googleapis/python-api-core/issues/590
280-
if ssl_credentials is not None and attempt_direct_path:
280+
if ssl_credentials and attempt_direct_path:
281281
raise ValueError("Using ssl_credentials with Direct Path is not supported")
282282

283283
composite_credentials = grpc_helpers._create_composite_credentials(

0 commit comments

Comments
 (0)