]> granicus.if.org Git - python/commitdiff
Remove catching OSError in ftphandler test. Only URLError is raised in urllib.request...
authorSenthil Kumaran <skumaran@gatech.edu>
Fri, 31 Mar 2017 05:43:05 +0000 (22:43 -0700)
committerGitHub <noreply@github.com>
Fri, 31 Mar 2017 05:43:05 +0000 (22:43 -0700)
Lib/test/test_urllib2.py

index 308acb3724cad1331eaf58fd75e50c070c6aabfa..b537fca3c31adf4bcf838a339a6fd6732551138e 100644 (file)
@@ -830,7 +830,6 @@ class HandlerTests(unittest.TestCase):
         for url, ftp in [
             ("file://ftp.example.com//foo.txt", False),
             ("file://ftp.example.com///foo.txt", False),
-# XXXX bug: fails with OSError, should be URLError
             ("file://ftp.example.com/foo.txt", False),
             ("file://somehost//foo/something.txt", False),
             ("file://localhost//foo/something.txt", False),
@@ -839,7 +838,7 @@ class HandlerTests(unittest.TestCase):
             try:
                 h.file_open(req)
             # XXXX remove OSError when bug fixed
-            except (urllib.error.URLError, OSError):
+            except urllib.error.URLError:
                 self.assertFalse(ftp)
             else:
                 self.assertIs(o.req, req)
@@ -1689,7 +1688,6 @@ class HandlerTests(unittest.TestCase):
         self.assertTrue(conn.fakesock.closed, "Connection not closed")
 
 
-
 class MiscTests(unittest.TestCase):
 
     def opener_has_handler(self, opener, handler_class):