[Python-checkins] cpython: Fixed tests on Windows for issue #21883.
serhiy.storchaka
python-checkins at python.org
Sat Oct 4 15:18:49 CEST 2014
https://hg.python.org/cpython/rev/85de13b746ac
changeset: 92807:85de13b746ac
parent: 92800:fc941169125e
user: Serhiy Storchaka <storchaka at gmail.com>
date: Sat Oct 04 16:09:02 2014 +0300
summary:
Fixed tests on Windows for issue #21883.
files:
Lib/ntpath.py | 2 +-
Lib/posixpath.py | 2 +-
Lib/test/test_genericpath.py | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -584,7 +584,7 @@
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
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -452,6 +452,6 @@
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
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py
--- a/Lib/test/test_genericpath.py
+++ b/Lib/test/test_genericpath.py
@@ -453,7 +453,8 @@
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')
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list