Skip to content

Commit 6124681

Browse files
committed
fixup issue with ssl_error_classes
1 parent 77c9cd3 commit 6124681

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

shotgun_api3/shotgun.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
from .lib import six
5959
from .lib import sgsix
6060
from .lib import sgutils
61-
from .lib.httplib2 import Http, ProxyInfo, socks, ssl_error_classes
61+
from .lib.httplib2 import Http, ProxyInfo, socks
6262
from .lib.sgtimezone import SgTimezone
6363

6464

@@ -3873,7 +3873,7 @@ def _make_call(self, verb, path, body, headers):
38733873
# otherwise and will not re-attempt.
38743874
# When we drop support of Python 2 and we will probably drop the
38753875
# next except, we might want to remove this except too.
3876-
except ssl_error_classes as e:
3876+
except (ssl.SSLError, ssl.CertificateError) as e:
38773877
# Test whether the exception is due to the fact that this is an older version of
38783878
# Python that cannot validate certificates encrypted with SHA-2. If it is, then
38793879
# fall back on disabling the certificate validation and try again - unless the

tests/test_unit.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
# not expressly granted therein are reserved by Shotgun Software Inc.
1212

1313
import os
14+
import ssl
1415
import unittest
1516
from unittest import mock
1617
import urllib.request
1718
import urllib.error
1819

1920
import shotgun_api3 as api
20-
from shotgun_api3.lib.httplib2 import Http, ssl_error_classes
21+
from shotgun_api3.lib.httplib2 import Http
2122

2223

2324
class TestShotgunInit(unittest.TestCase):
@@ -771,7 +772,7 @@ def test_httplib(self):
771772
"""
772773
# First check that we get an error when trying to connect to a known dummy bad URL
773774
self.assertRaises(
774-
ssl_error_classes,
775+
(ssl.SSLError, ssl.CertificateError),
775776
self._check_url_with_sg_api_httplib2,
776777
self.bad_url,
777778
self.certs,

0 commit comments

Comments
 (0)