Skip to content

Commit

Permalink
Fixed hasattr issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Apr 2, 2019
1 parent 5a192dd commit 1913b8b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,10 +1421,11 @@ def init_webapp(self):
# SSL may be missing, so only import it if it's to be used
import ssl
# Disable SSLv3 by default, since its use is discouraged.
ssl_options.setdefault(
'ssl_version',
ssl.PROTOCOL_TLS if hasattr(ssl, PROTOCOL_TLS) else ssl.PROTOCOL_SSLv23
_ssl_protocol = (
ssl.PROTOCOL_TLS if hasattr(ssl, 'PROTOCOL_TLS')
else ssl.PROTOCOL_SSLv23
)
ssl_options.setdefault('ssl_version', _ssl_protocol)
if ssl_options.get('ca_certs', False):
ssl_options.setdefault('cert_reqs', ssl.CERT_REQUIRED)

Expand Down

0 comments on commit 1913b8b

Please sign in to comment.