aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/codecs.py
diff options
context:
space:
mode:
authorSebastian Rittau <srittau@rittau.biz>2024-07-15 19:18:37 +0200
committerGitHub <noreply@github.com>2024-07-15 17:18:37 +0000
commit74fbdcd74abc1bac6846ec92f00d21fe8f87610b (patch)
tree9e2438e64e8d5817f7acff79a72290afecb5d573 /Lib/codecs.py
parent94bee45dee41876e88fe023b9163178d376355dc (diff)
downloadcpython-74fbdcd74abc1bac6846ec92f00d21fe8f87610b.tar.gz
cpython-74fbdcd74abc1bac6846ec92f00d21fe8f87610b.zip
gh-121785: Remove unused code from codecs.py (GH-121787)
It was only needed for non-Unicode Python builds, which aren't supported anymore.
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r--Lib/codecs.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py
index a887e5d4c94..e365e6cf229 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -1109,21 +1109,12 @@ def make_encoding_map(decoding_map):
### error handlers
-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")
- namereplace_errors = lookup_error("namereplace")
-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
- namereplace_errors = None
+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")
+namereplace_errors = lookup_error("namereplace")
# Tell modulefinder that using codecs probably needs the encodings
# package