diff options
| author | Nate Prewitt <Nate.Prewitt@gmail.com> | 2017-07-03 17:21:56 -0600 |
|---|---|---|
| committer | Nate Prewitt <Nate.Prewitt@gmail.com> | 2017-07-03 17:21:56 -0600 |
| commit | f6e07bb27f9fe092dabb1945ef7fd515db7870fe (patch) | |
| tree | 8f5371e67db1a36e362d9c1c173ce4c3245fe33f /requests/help.py | |
| parent | bbeb1c32d2ad4cdc1053e4b614bd7aa4eb9ebdde (diff) | |
| download | python-requests-f6e07bb27f9fe092dabb1945ef7fd515db7870fe.tar.gz | |
fix OPENSSL_VERSION_NUMBER check on Python2.6's ssl module
Diffstat (limited to 'requests/help.py')
| -rw-r--r-- | requests/help.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/requests/help.py b/requests/help.py index 695b5ee2..cd961c78 100644 --- a/requests/help.py +++ b/requests/help.py @@ -85,12 +85,16 @@ def info(): 'version': getattr(cryptography, '__version__', ''), } + # OPENSSL_VERSION_NUMBER doesn't exist in the Python 2.6 ssl module. + system_ssl = getattr(ssl, 'OPENSSL_VERSION_NUMBER', None) + system_ssl_info = { + 'version': '%x' % system_ssl if system_ssl is not None else '' + } + return { 'platform': platform_info, 'implementation': implementation_info, - 'system_ssl': { - 'version': '%x' % ssl.OPENSSL_VERSION_NUMBER, - }, + 'system_ssl': system_ssl_info, 'using_pyopenssl': pyopenssl is not None, 'pyOpenSSL': pyopenssl_info, 'urllib3': urllib3_info, |
