[Python-checkins] python/dist/src/Lib copy_reg.py,1.24,1.25
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Sat, 07 Jun 2003 13:10:56 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv7551
Modified Files:
copy_reg.py
Log Message:
Patch #750595: Refer to type complex using builtin. Fixes #595837.
Backported to 2.2.
Index: copy_reg.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/copy_reg.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** copy_reg.py 21 Feb 2003 22:20:31 -0000 1.24
--- copy_reg.py 7 Jun 2003 20:10:54 -0000 1.25
***************
*** 29,36 ****
# Example: provide pickling support for complex numbers.
! def pickle_complex(c):
! return complex, (c.real, c.imag)
! pickle(type(1j), pickle_complex, complex)
# Support for pickling new-style objects
--- 29,42 ----
# Example: provide pickling support for complex numbers.
! try:
! complex
! except NameError:
! pass
! else:
! def pickle_complex(c):
! return complex, (c.real, c.imag)
!
! pickle(complex, pickle_complex, complex)
# Support for pickling new-style objects