From: Victor Stinner Date: Thu, 19 Aug 2010 17:35:00 +0000 (+0000) Subject: test_pep277: display the filename as ascii on failure X-Git-Tag: v3.2a2~203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c1808a1a81c22ae60d170320f454afb207454d1;p=thirdparty%2FPython%2Fcpython.git test_pep277: display the filename as ascii on failure --- diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py index 0699317e1eb8..862cdbbb864a 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)