Fixed tests on Windows for issue #21883.
This commit is contained in:
parent
d32abc12e8
commit
e4f47088af
|
@ -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):
|
||||||
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):
|
||||||
|
|
||||||
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')
|
||||||
|
|
Loading…
Reference in New Issue