This repository has been archived by the owner on Nov 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 431
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/cc @craigcitro |
Is there anyone to review this? |
I took a look, but I don't think I know this part of the code or the language subtleties well enough to be the sole approver. I would suggest @nathanielmanistaatgoogle, but possibly also @craigcitro or @jcgregorio. |
@@ -37,7 +39,10 @@ class AppIdentityError(Exception): | |||
|
|||
|
|||
try: | |||
from OpenSSL import crypto | |||
_, package_dir, _ = imp.find_module('OpenSSL') |
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.
one little thing, otherwise LGTM |
This is to speed up import times. In OpenSSL 0.14 the import takes 0.5 seconds due to cffi on-demand build of extensions in the cryptography library. For classes and functions which are conditionally defined based on the existence of OpenSSL.crypto, we check that the module exists (but don't import it) using imp.find_module.
dhermes
force-pushed
the
speedup-openssl-import
branch
from
April 15, 2015 22:44
9dc6ba2
to
613ab46
Compare
@craigcitro I Feel free to take a second look. I don't have merge privileges so someone will need to use your LGTM for me. |
@dhermes yeah, i don't think we have an easy way to give non-googlers push rights on this repo. merging now. |
craigcitro
added a commit
that referenced
this pull request
Apr 15, 2015
Deferring OpenSSL import until usage.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is to speed up import times. In OpenSSL 0.14 the import takes
0.5 seconds due to cffi on-demand build of extensions in the
cryptography library.
For classes and functions which are conditionally defined based on
the existence of OpenSSL.crypto, we check that the module
exists (but don't import it) using imp.find_module.
See pyca/pyopenssl#137 for context (originally discovered by me because of google/apitools#14).