diff -r cb9a3985df00 Lib/test/test_urllib2net.py --- a/Lib/test/test_urllib2net.py Thu May 08 17:43:25 2014 -0500 +++ b/Lib/test/test_urllib2net.py Fri May 09 09:00:51 2014 +0200 @@ -7,10 +7,15 @@ import urllib.error import urllib.request import sys + try: import ssl + SUPPORTS_SSL = True except ImportError: - ssl = None + SUPPORTS_SSL = False + +requires_ssl = unittest.skipUnless(SUPPORTS_SSL, 'SSL not supported') + support.requires("network") @@ -156,6 +161,7 @@ ## self._test_urls(urls, self._extra_handlers()+[bauth, dauth]) + @requires_ssl def test_urlwithfrag(self): urlwith_frag = "https://docs.python.org/2/glossary.html#glossary" with support.transient_internet(urlwith_frag): @@ -164,6 +170,7 @@ self.assertEqual(res.geturl(), "https://docs.python.org/2/glossary.html#glossary") + @requires_ssl def test_redirect_url_withfrag(self): redirect_url_with_frag = "http://bit.ly/1iSHToT" with support.transient_internet(redirect_url_with_frag):