mirror of
https://github.com/sivel/speedtest-cli.git
synced 2026-08-04 14:49:36 +00:00
ssl.CertificateError not always available
This commit is contained in:
parent
69bae532c5
commit
e4218c7612
1 changed files with 7 additions and 2 deletions
|
|
@ -205,8 +205,13 @@ else:
|
|||
# Exception "constants" to support Python 2 through Python 3
|
||||
try:
|
||||
import ssl
|
||||
HTTP_ERRORS = (HTTPError, URLError, socket.error, ssl.SSLError,
|
||||
ssl.CertificateError)
|
||||
try:
|
||||
CERT_ERROR = (ssl.CertificateError,)
|
||||
except AttributeError:
|
||||
CERT_ERROR = tuple()
|
||||
|
||||
HTTP_ERRORS = ((HTTPError, URLError, socket.error, ssl.SSLError) +
|
||||
CERT_ERROR)
|
||||
except ImportError:
|
||||
HTTP_ERRORS = (HTTPError, URLError, socket.error)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue