From 339d0f720e86dc34837547c90d3003a4a68d7d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Fri, 17 Aug 2001 18:39:25 +0000 Subject: 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. --- Lib/test/test_format.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Lib/test/test_format.py') diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py index c74db0fedc..a89ed52e92 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") -- cgit v1.2.1