Issue #20939: Use www.example.com instead of www.python.org to avoid test
failures when ssl is not present.
diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py
index 651301b..36ac941 100644
--- a/Lib/test/test_robotparser.py
+++ b/Lib/test/test_robotparser.py
@@ -2,6 +2,12 @@
from test import test_support
from urllib2 import urlopen, HTTPError
+HAVE_HTTPS = True
+try:
+ from urllib2 import HTTPSHandler
+except ImportError:
+ HAVE_HTTPS = False
+
class RobotTestCase(unittest.TestCase):
def __init__(self, index, parser, url, good, agent):
unittest.TestCase.__init__(self)
@@ -269,6 +275,7 @@
self.skipTest('%s is unavailable' % url)
self.assertEqual(parser.can_fetch("*", robots_url), False)
+ @unittest.skipUnless(HAVE_HTTPS, 'need SSL support to download license')
def testPythonOrg(self):
test_support.requires('network')
with test_support.transient_internet('www.python.org'):