]> granicus.if.org Git - python/commitdiff
Test for UnicodeError instead of ImportError to determine whether
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 17 Mar 2003 18:30:15 +0000 (18:30 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 17 Mar 2003 18:30:15 +0000 (18:30 +0000)
the test file name can be encoded.

Lib/test/test_unicode_file.py

index 6d7dec55028b70ede9a1d3e2e943c32f25fcc7a8..255cea393304e304cbb6919b04879c5c5210b503 100644 (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.")