summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_format.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-08-17 18:39:25 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-08-17 18:39:25 (GMT)
commit339d0f720e86dc34837547c90d3003a4a68d7d46 (patch)
tree2059e5d02f490540e759800b127d50f3fcd8c2b5 /Lib/test/test_format.py
parentf75976617bb36c892ee8a0f6a6fd3caddbd38cea (diff)
downloadcpython-339d0f720e86dc34837547c90d3003a4a68d7d46.zip
cpython-339d0f720e86dc34837547c90d3003a4a68d7d46.tar.gz
cpython-339d0f720e86dc34837547c90d3003a4a68d7d46.tar.bz2
Patch #445762: Support --disable-unicode
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests.
Diffstat (limited to 'Lib/test/test_format.py')
-rw-r--r--Lib/test/test_format.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index c74db0f..a89ed52 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -1,4 +1,4 @@
-from test_support import verbose
+from test_support import verbose, have_unicode
import sys
# test string formatting operator (I am not sure if this is being tested
@@ -34,7 +34,8 @@ def testformat(formatstr, args, output=None):
def testboth(formatstr, *args):
testformat(formatstr, *args)
- testformat(unicode(formatstr), *args)
+ if have_unicode:
+ testformat(unicode(formatstr), *args)
testboth("%.1d", (1,), "1")
@@ -212,5 +213,6 @@ def test_exc(formatstr, args, exception, excmsg):
test_exc('abc %a', 1, ValueError,
"unsupported format character 'a' (0x61) at index 5")
-test_exc(u'abc %\u3000', 1, ValueError,
- "unsupported format character '?' (0x3000) at index 5")
+if have_unicode:
+ test_exc(unicode('abc %\u3000'), 1, ValueError,
+ "unsupported format character '?' (0x3000) at index 5")