[Jython-checkins] jython: Fixing SSL treatment on jython, re-enabling related tests

alan.kennedy jython-checkins at python.org
Sun Feb 3 15:01:47 CET 2013


http://hg.python.org/jython/rev/c52aac19c12e
changeset:   6982:c52aac19c12e
user:        Alan Kennedy <alan at xhaus.com>
date:        Sun Feb 03 13:59:04 2013 +0000
summary:
  Fixing SSL treatment on jython, re-enabling related tests

files:
  Lib/ftplib.py            |  3 ++-
  Lib/test/test_urllib.py  |  1 -
  Lib/test/test_urllib2.py |  1 -
  3 files changed, 2 insertions(+), 3 deletions(-)


diff --git a/Lib/ftplib.py b/Lib/ftplib.py
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -593,7 +593,8 @@
 
 try:
     import ssl
-except ImportError:
+    ssl.PROTOCOL_TLSv1
+except (ImportError, AttributeError):
     pass
 else:
     class FTP_TLS(FTP):
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -240,7 +240,6 @@
         self.assertFalse(os.path.exists(tmp_file))
         self.assertRaises(IOError, urllib.urlopen, tmp_fileurl)
 
-    @unittest.skipIf(test_support.is_jython, "Required SSL support not yet available on jython")
     def test_ftp_nonexisting(self):
         self.assertRaises(IOError, urllib.urlopen,
                 'ftp://localhost/not/existing/file.py')
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -605,7 +605,6 @@
 
 class HandlerTests(unittest.TestCase):
 
-    @unittest.skipIf(test_support.is_jython, "Required SSL support not yet available on jython")
     def test_ftp(self):
         class MockFTPWrapper:
             def __init__(self, data): self.data = data

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list