Skip to content

Commit

Permalink
Test for UnicodeError instead of ImportError to determine whether
Browse files Browse the repository at this point in the history
the test file name can be encoded.
  • Loading branch information
loewis committed Mar 17, 2003
1 parent 54e7d2c commit c2ca32d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_unicode_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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.")
Expand Down

0 comments on commit c2ca32d

Please sign in to comment.