Commit a2185911 authored by Martin v. Löwis's avatar Martin v. Löwis

Patch #750595: Refer to type complex using builtin. Fixes #595837.

Backported to 2.2.
parent 6a380247
......@@ -28,10 +28,16 @@ def constructor(object):
# Example: provide pickling support for complex numbers.
def pickle_complex(c):
return complex, (c.real, c.imag)
try:
complex
except NameError:
pass
else:
pickle(type(1j), pickle_complex, complex)
def pickle_complex(c):
return complex, (c.real, c.imag)
pickle(complex, pickle_complex, complex)
# Support for pickling new-style objects
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment