diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2005-03-08 15:03:08 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2005-03-08 15:03:08 +0000 |
commit | e2713becd8cb0c3b2db4d33832dd57a1d619f0f3 (patch) | |
tree | c46d31f73c95c9a969b6704719dac3e83eb435f1 /Lib/codecs.py | |
parent | Convert file names of posix.access according to the file system encoding. (diff) | |
download | cpython-e2713becd8cb0c3b2db4d33832dd57a1d619f0f3.tar.gz cpython-e2713becd8cb0c3b2db4d33832dd57a1d619f0f3.tar.bz2 cpython-e2713becd8cb0c3b2db4d33832dd57a1d619f0f3.zip |
Build with --disable-unicode again. Fixes #1158607.
Will backport to 2.4.
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r-- | Lib/codecs.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py index b283925e01f..b4103fb6e46 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 |