Kaydet (Commit) e4f47088 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Fixed tests on Windows for issue #21883.

üst d32abc12
...@@ -584,7 +584,7 @@ def relpath(path, start=None): ...@@ -584,7 +584,7 @@ def relpath(path, start=None):
if not rel_list: if not rel_list:
return curdir return curdir
return join(*rel_list) return join(*rel_list)
except (TypeError, ValueError, AttributeError, BytesWarning): except (TypeError, ValueError, AttributeError, BytesWarning, DeprecationWarning):
genericpath._check_arg_types('relpath', path, start) genericpath._check_arg_types('relpath', path, start)
raise raise
......
...@@ -452,6 +452,6 @@ def relpath(path, start=None): ...@@ -452,6 +452,6 @@ def relpath(path, start=None):
if not rel_list: if not rel_list:
return curdir return curdir
return join(*rel_list) return join(*rel_list)
except (TypeError, AttributeError, BytesWarning): except (TypeError, AttributeError, BytesWarning, DeprecationWarning):
genericpath._check_arg_types('relpath', path, start) genericpath._check_arg_types('relpath', path, start)
raise raise
...@@ -453,7 +453,8 @@ class CommonTest(GenericTest): ...@@ -453,7 +453,8 @@ class CommonTest(GenericTest):
def test_relpath_errors(self): def test_relpath_errors(self):
# Check relpath() raises friendly TypeErrors. # 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" errmsg = "Can't mix strings and bytes in path components"
with self.assertRaisesRegex(TypeError, errmsg): with self.assertRaisesRegex(TypeError, errmsg):
self.pathmodule.relpath(b'bytes', 'str') self.pathmodule.relpath(b'bytes', 'str')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment