summaryrefslogtreecommitdiffstats
path: root/Lib/copyreg.py
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2022-11-11 09:56:57 (GMT)
committerGitHub <noreply@github.com>2022-11-11 09:56:57 (GMT)
commitfaf7dfa656bd52959156fed39a4c680b2b13e032 (patch)
tree439a753448c79ef446383a37e6aee99ec25a3109 /Lib/copyreg.py
parente00d730efe43e10393a37cfedb018f04624b3c5e (diff)
downloadcpython-faf7dfa656bd52959156fed39a4c680b2b13e032.zip
cpython-faf7dfa656bd52959156fed39a4c680b2b13e032.tar.gz
cpython-faf7dfa656bd52959156fed39a4c680b2b13e032.tar.bz2
gh-99325: Remove unused `NameError` handling (#99326)
Diffstat (limited to 'Lib/copyreg.py')
-rw-r--r--Lib/copyreg.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/Lib/copyreg.py b/Lib/copyreg.py
index c8a52a2..5783924 100644
--- a/Lib/copyreg.py
+++ b/Lib/copyreg.py
@@ -25,16 +25,10 @@ def constructor(object):
# Example: provide pickling support for complex numbers.
-try:
- complex
-except NameError:
- pass
-else:
+def pickle_complex(c):
+ return complex, (c.real, c.imag)
- def pickle_complex(c):
- return complex, (c.real, c.imag)
-
- pickle(complex, pickle_complex, complex)
+pickle(complex, pickle_complex, complex)
def pickle_union(obj):
import functools, operator