summaryrefslogtreecommitdiffstats
path: root/Lib/codecs.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2005-03-08 15:03:08 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2005-03-08 15:03:08 (GMT)
commite2713becd8cb0c3b2db4d33832dd57a1d619f0f3 (patch)
treec46d31f73c95c9a969b6704719dac3e83eb435f1 /Lib/codecs.py
parentb60ae9960182b8eecb26da12171917ee5a6cc1fc (diff)
downloadcpython-e2713becd8cb0c3b2db4d33832dd57a1d619f0f3.zip
cpython-e2713becd8cb0c3b2db4d33832dd57a1d619f0f3.tar.gz
cpython-e2713becd8cb0c3b2db4d33832dd57a1d619f0f3.tar.bz2
Build with --disable-unicode again. Fixes #1158607.
Will backport to 2.4.
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r--Lib/codecs.py18
1 files changed, 13 insertions, 5 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