Skip to content

Commit 42028ed

Browse files
fix: fix python-api-core dependency issue (googleapis#931)
`ClientOptions` doesn't have `client_encryted_cert_source` property yet. Check the existence of the property before accessing it.
1 parent cafb9e0 commit 42028ed

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

googleapiclient/discovery.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,11 @@ def build_from_document(
441441
raise MutualTLSChannelError(
442442
"ClientOptions.client_cert_source is not supported, please use ClientOptions.client_encrypted_cert_source."
443443
)
444-
if client_options and client_options.client_encrypted_cert_source:
444+
if (
445+
client_options
446+
and hasattr(client_options, "client_encrypted_cert_source")
447+
and client_options.client_encrypted_cert_source
448+
):
445449
client_cert_to_use = client_options.client_encrypted_cert_source
446450
elif adc_cert_path and adc_key_path and mtls.has_default_client_cert_source():
447451
client_cert_to_use = mtls.default_client_encrypted_cert_source(

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"httplib2>=0.9.2,<1dev",
4242
"google-auth>=1.16.0",
4343
"google-auth-httplib2>=0.0.3",
44-
"google-api-core>=1.13.0,<2dev",
44+
"google-api-core>=1.17.0,<2dev",
4545
"six>=1.6.1,<2dev",
4646
"uritemplate>=3.0.0,<4dev",
4747
]

0 commit comments

Comments
 (0)