From 5c1808a1a81c22ae60d170320f454afb207454d1 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 19 Aug 2010 17:35:00 +0000 Subject: [PATCH] test_pep277: display the filename as ascii on failure --- Lib/test/test_pep277.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py index 0699317e1e..862cdbbb86 100644 --- a/Lib/test/test_pep277.py +++ b/Lib/test/test_pep277.py @@ -132,7 +132,10 @@ class UnicodeFileTests(unittest.TestCase): for name in others: if sys.platform == 'darwin' and normalize('NFD', name) in files: # Mac OS X decomposes Unicode names. See comment above. - os.stat(name) + try: + os.stat(name) + except OSError as err: + raise AssertionError("File %a doesn't exist" % name) continue self._apply_failure(open, name, IOError) self._apply_failure(os.stat, name, OSError) -- 2.40.0