aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-02-05 15:02:42 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-02-05 15:02:42 -0800
commitb98699df32344ba244fa4794c6daa173919f88fe (patch)
treea4a2c9e83d1706744fa2a3f7dbb1a0ed9befac6d
parentf970eaa676eb0cd89cdb2389f03d365899812822 (diff)
downloadcryptography-b98699df32344ba244fa4794c6daa173919f88fe.tar.gz
cryptography-b98699df32344ba244fa4794c6daa173919f88fe.tar.bz2
cryptography-b98699df32344ba244fa4794c6daa173919f88fe.zip
Write comments as complete sentences
-rw-r--r--cryptography/hazmat/bindings/openssl/binding.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/cryptography/hazmat/bindings/openssl/binding.py b/cryptography/hazmat/bindings/openssl/binding.py
index cde3bdbd..3adcc887 100644
--- a/cryptography/hazmat/bindings/openssl/binding.py
+++ b/cryptography/hazmat/bindings/openssl/binding.py
@@ -86,7 +86,8 @@ class Binding(object):
if cls.ffi is not None and cls.lib is not None:
return
- # platform check to set the right library names
+ # OpenSSL goes by a different library name on different operating
+ # systems.
if sys.platform != "win32":
libraries = ["crypto", "ssl"]
else: # pragma: no cover
@@ -98,7 +99,8 @@ class Binding(object):
@classmethod
def is_available(cls):
- # OpenSSL is the only binding so for now it must always be available
+ # For now, OpenSSL is considered our "default" binding, so we treat it
+ # as always available.
return True
@classmethod
@@ -112,15 +114,15 @@ class Binding(object):
cls._lock_cb
)
- # use Python's implementation if available
-
+ # Use Python's implementation if available, importing _ssl triggers
+ # the setup for this.
__import__("_ssl")
if cls.lib.CRYPTO_get_locking_callback() != cls.ffi.NULL:
return
- # otherwise setup our version
-
+ # If nothing else has setup a locking callback already, we set up
+ # our own
num_locks = cls.lib.CRYPTO_num_locks()
cls._locks = [threading.Lock() for n in range(num_locks)]