diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2005-03-08 15:05:18 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2005-03-08 15:05:18 (GMT) |
commit | ad80c6bb2afa6d46fc19104127d7b02f8a5e2169 (patch) | |
tree | 3e1a47152e5f36929f0730c70604b904eb6e9f99 /Lib | |
parent | 6349e8956774f675eb10a81d3498eb613ebb397f (diff) | |
download | cpython-ad80c6bb2afa6d46fc19104127d7b02f8a5e2169.zip cpython-ad80c6bb2afa6d46fc19104127d7b02f8a5e2169.tar.gz cpython-ad80c6bb2afa6d46fc19104127d7b02f8a5e2169.tar.bz2 |
Build with --disable-unicode again. Fixes #1158607.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/codecs.py | 18 | ||||
-rw-r--r-- | Lib/test/test_support.py | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py index b283925..b4103fb 100644 --- a/Lib/codecs.py +++ b/Lib/codecs.py @@ -720,11 +720,19 @@ def make_encoding_map(decoding_map): ### error handlers -strict_errors = lookup_error("strict") -ignore_errors = lookup_error("ignore") -replace_errors = lookup_error("replace") -xmlcharrefreplace_errors = lookup_error("xmlcharrefreplace") -backslashreplace_errors = lookup_error("backslashreplace") +try: + strict_errors = lookup_error("strict") + ignore_errors = lookup_error("ignore") + replace_errors = lookup_error("replace") + xmlcharrefreplace_errors = lookup_error("xmlcharrefreplace") + backslashreplace_errors = lookup_error("backslashreplace") +except LookupError: + # In --disable-unicode builds, these error handler are missing + strict_errors = None + ignore_errors = None + replace_errors = None + xmlcharrefreplace_errors = None + backslashreplace_errors = None # Tell modulefinder that using codecs probably needs the encodings # package diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 485e9e0..a296caf 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -144,7 +144,7 @@ else: TESTFN_UNICODE_UNENCODEABLE = None else: # Japanese characters (I think - from bug 846133) - TESTFN_UNICODE_UNENCODEABLE = u"@test-\u5171\u6709\u3055\u308c\u308b" + TESTFN_UNICODE_UNENCODEABLE = eval('u"@test-\u5171\u6709\u3055\u308c\u308b"') try: # XXX - Note - should be using TESTFN_ENCODING here - but for # Windows, "mbcs" currently always operates as if in |