]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121785: Remove unused code from codecs.py (GH-121787)
authorSebastian Rittau <srittau@rittau.biz>
Mon, 15 Jul 2024 17:18:37 +0000 (19:18 +0200)
committerGitHub <noreply@github.com>
Mon, 15 Jul 2024 17:18:37 +0000 (17:18 +0000)
It was only needed for non-Unicode Python builds,
which aren't supported anymore.

Lib/codecs.py

index a887e5d4c94a38da2ab1717ae50fb1c57d054e1b..e365e6cf22929fc4603e45e28aead73ae4487719 100644 (file)
@@ -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