Kaydet (Commit) c2ca32d9 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Test for UnicodeError instead of ImportError to determine whether

the test file name can be encoded.
üst 54e7d2c0
...@@ -7,7 +7,7 @@ from test.test_support import verify, TestSkipped, TESTFN_UNICODE ...@@ -7,7 +7,7 @@ from test.test_support import verify, TestSkipped, TESTFN_UNICODE
from test.test_support import TESTFN_ENCODING from test.test_support import TESTFN_ENCODING
try: try:
TESTFN_ENCODED = TESTFN_UNICODE.encode(TESTFN_ENCODING) TESTFN_ENCODED = TESTFN_UNICODE.encode(TESTFN_ENCODING)
except (ImportError, TypeError): except (UnicodeError, TypeError):
# Either the file system encoding is None, or the file name # Either the file system encoding is None, or the file name
# cannot be encoded in the file system encoding. # cannot be encoded in the file system encoding.
raise TestSkipped("No Unicode filesystem semantics on this platform.") raise TestSkipped("No Unicode filesystem semantics on this platform.")
......
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