]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Don't try to convert the test filename to Unicode with -U.
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 9 Nov 2002 19:57:26 +0000 (19:57 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 9 Nov 2002 19:57:26 +0000 (19:57 +0000)
Lib/test/test_support.py

index 2e4c93a740822ce9c96d4db4b3cecaff2e7d8eb5..075d83b94ae7b8ce60b02b714dcef62134261bca 100644 (file)
@@ -92,7 +92,12 @@ elif os.name != 'riscos':
     TESTFN = '@test'
     # Unicode name only used if TEST_FN_ENCODING exists for the platform.
     if have_unicode:
-        TESTFN_UNICODE=unicode("@test-\xe0\xf2", "latin-1") # 2 latin characters.
+        if isinstance('', unicode):
+            # python -U
+            # XXX perhaps unicode() should accept Unicode strings?
+            TESTFN_UNICODE="@test-\xe0\xf2"
+        else:
+            TESTFN_UNICODE=unicode("@test-\xe0\xf2", "latin-1") # 2 latin characters.
         if os.name=="nt":
             TESTFN_ENCODING="mbcs"
 else: