]> granicus.if.org Git - python/commitdiff
Fixed tests on Windows for issue #21883.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 4 Oct 2014 13:09:02 +0000 (16:09 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 4 Oct 2014 13:09:02 +0000 (16:09 +0300)
Lib/ntpath.py
Lib/posixpath.py
Lib/test/test_genericpath.py

index 8f5dc55bec5815dcc8f2b9f66113e687a7791d58..ee1a2157a14200113e5d1a2072021681282fdc52 100644 (file)
@@ -584,7 +584,7 @@ def relpath(path, start=None):
         if not rel_list:
             return curdir
         return join(*rel_list)
-    except (TypeError, ValueError, AttributeError, BytesWarning):
+    except (TypeError, ValueError, AttributeError, BytesWarning, DeprecationWarning):
         genericpath._check_arg_types('relpath', path, start)
         raise
 
index ce5f7928cc73de60e25798de97da7457a7e90ef8..44ed8383f2e4509e75298cc19fad1245d1eddcf4 100644 (file)
@@ -452,6 +452,6 @@ def relpath(path, start=None):
         if not rel_list:
             return curdir
         return join(*rel_list)
-    except (TypeError, AttributeError, BytesWarning):
+    except (TypeError, AttributeError, BytesWarning, DeprecationWarning):
         genericpath._check_arg_types('relpath', path, start)
         raise
index 2e31fe42362d6c4174b8d4dd7a601e70d7e191db..f2722bcc8a51fa91a2ee652eecd40c4636f3b80d 100644 (file)
@@ -453,7 +453,8 @@ class CommonTest(GenericTest):
 
     def test_relpath_errors(self):
         # Check relpath() raises friendly TypeErrors.
-        with support.check_warnings(('', BytesWarning), quiet=True):
+        with support.check_warnings(('', (BytesWarning, DeprecationWarning)),
+                                    quiet=True):
             errmsg = "Can't mix strings and bytes in path components"
             with self.assertRaisesRegex(TypeError, errmsg):
                 self.pathmodule.relpath(b'bytes', 'str')