]> 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 06:15:56 +0000 (23:15 -0700)
committerGitHub <noreply@github.com>
Fri, 31 Mar 2017 06:15:56 +0000 (23:15 -0700)
(cherry picked from commit ed3dd1c02af6872bd0748f7b9a5dadb89f7b830f)

Lib/test/test_urllib2.py

index 8c11b40daa099a8eccfc9417686bbdddb1034136..49e6c82d4339a829bd1a5912345082e62693c4bd 100644 (file)
@@ -826,7 +826,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),
@@ -835,7 +834,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)
@@ -1616,7 +1615,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):