-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowing pyOpenSSL import to fail for GAE. #1446
Conversation
@dhermes ping me when you're ready for review. |
I am "ready" for review. The AppVeyor fail is noted in #1434 IMO, the coverage drop just needs a pragma no cover. WDYT? |
I think it'd be nice to see a test case for this, if possible. |
@jonparrott I have previously implemented tests that mock import failures and the pay-off does not justify the amount that goes in. Maybe there is a better way and I just don't know how to do it? |
I guess I more want to ensure that |
OK cool I can add that feature and test for it. |
@jonparrott PTAL. (Also remind me to squash |
@@ -181,7 +187,11 @@ def _get_pem_key(credentials): | |||
raise TypeError((credentials, | |||
'not a valid service account credentials type')) | |||
|
|||
return crypto.load_privatekey(crypto.FILETYPE_PEM, pem_text) | |||
if crypto is None: | |||
raise EnvironmentError('pyOpenSSL must be installed to load a ' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
LGTM with minor nits. You can squash commits if you want, but I don't see an issue with these being separate commits. |
@jonparrott PTAL |
@@ -207,6 +217,9 @@ def _get_signature_bytes(credentials, string_to_sign): | |||
pkey = _get_pem_key(credentials) | |||
if not isinstance(string_to_sign, six.binary_type): | |||
string_to_sign = string_to_sign.encode('utf-8') | |||
if crypto is None: | |||
raise EnvironmentError('pyOpenSSL must be installed to sign ' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Good to go with the tiniest little nit. Feel free to merge once that's fixed and travis is happy. |
Allowing pyOpenSSL import to fail for GAE.
…python-docs-samples#1446) * add auto punctuation sample * correct docstring
…python-docs-samples#1446) * add auto punctuation sample * correct docstring
…python-docs-samples#1446) * add auto punctuation sample * correct docstring
…python-docs-samples#1446) * add auto punctuation sample * correct docstring
Fixes #1445.