Test for UnicodeError instead of ImportError to determine whether

the test file name can be encoded.
This commit is contained in:
Martin v. Löwis 2003-03-17 18:30:15 +00:00
parent 54e7d2c029
commit c2ca32d9ae

View File

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