[Python-checkins] python/dist/src/Lib copy_reg.py,1.26,1.27
jhylton@users.sourceforge.net
jhylton@users.sourceforge.net
Fri, 27 Jun 2003 09:58:45 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv16769
Modified Files:
copy_reg.py
Log Message:
Revert previous checkin and just add a comment about constructor_ob.
There's no point to passing it anymore, but there's a test that
expects the call to fail if you pass a non-callable object.
Index: copy_reg.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/copy_reg.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** copy_reg.py 26 Jun 2003 23:20:20 -0000 1.26
--- copy_reg.py 27 Jun 2003 16:58:43 -0000 1.27
***************
*** 13,17 ****
def pickle(ob_type, pickle_function, constructor_ob=None):
- # constructor_ob exists only for backwards compatibility.
if type(ob_type) is _ClassType:
raise TypeError("copy_reg is not intended for use with classes")
--- 13,16 ----
***************
*** 21,27 ****
dispatch_table[ob_type] = pickle_function
def constructor(object):
- # XXX This function should be deprecated. It is a vestige of
- # the old __safe_for_unpickling__ code.
if not callable(object):
raise TypeError("constructors must be callable")
--- 20,29 ----
dispatch_table[ob_type] = pickle_function
+ # The constructor_ob function is a vestige of safe for unpickling.
+ # There is no reason for the caller to pass it anymore.
+ if constructor_ob is not None:
+ constructor(constructor_ob)
+
def constructor(object):
if not callable(object):
raise TypeError("constructors must be callable")