]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
easy --disable-unicode proofing.
authorMichael W. Hudson <mwh@python.net>
Mon, 20 May 2002 14:15:42 +0000 (14:15 +0000)
committerMichael W. Hudson <mwh@python.net>
Mon, 20 May 2002 14:15:42 +0000 (14:15 +0000)
Lib/test/test_binascii.py

index 5b45f7d03a34f1954a987b1bbe83d8dc16b28f0b..d4a905a24c3a8d295e7e23de90604db27f0ae4b1 100755 (executable)
@@ -1,6 +1,6 @@
 """Test the binascii C module."""
 
-from test_support import verify, verbose
+from test_support import verify, verbose, have_unicode
 import binascii
 
 # Show module doc string
@@ -112,7 +112,9 @@ else:
     print 'expected TypeError not raised'
 
 # Verify the treatment of Unicode strings
-verify(binascii.hexlify(u'a') == '61', "hexlify failed for Unicode")
+if have_unicode:
+    verify(binascii.hexlify(unicode('a', 'ascii')) == '61', 
+           "hexlify failed for Unicode")
 
 # A test for SF bug 534347 (segfaults without the proper fix)
 try: