diff options
-rw-r--r-- | Lib/distutils/tests/test_upload.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/distutils/tests/test_upload.py b/Lib/distutils/tests/test_upload.py index d269686..4a71ca4 100644 --- a/Lib/distutils/tests/test_upload.py +++ b/Lib/distutils/tests/test_upload.py @@ -72,13 +72,13 @@ class uploadTestCase(PyPIRCCommandTestCase): def setUp(self): super(uploadTestCase, self).setUp() - self.old_class = httpclient.HTTPSConnection + if hasattr(httpclient, 'HTTPSConnection'): + self.addCleanup(setattr, httpclient, 'HTTPSConnection', + httpclient.HTTPSConnection) + else: + self.addCleanup(delattr, httpclient, 'HTTPSConnection') self.conn = httpclient.HTTPSConnection = FakeConnection() - def tearDown(self): - httpclient.HTTPSConnection = self.old_class - super(uploadTestCase, self).tearDown() - def test_finalize_options(self): # new format |