[Stackless-checkins] CVS: slpdev/src/2.2/src/Lib pickle.py,1.3,1.4
Christian Tismer
tismer at centera.de
Sat May 1 02:44:36 CEST 2004
- Previous message: [Stackless-checkins] CVS: slpdev/src/2.2/src/Include Python.h, 1.8, 1.9 frameobject.h, 1.21, 1.22 methodobject.h, 1.4, 1.5 object.h, 1.8, 1.9 pyerrors.h, 1.2, 1.3 pystate.h, 1.8, 1.9
- Next message: [Stackless-checkins] CVS: slpdev/src/2.2/src/Lib/email/test/data msg_21.txt, 1.1.1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/slpdev/src/2.2/src/Lib
In directory centera.de:/home/tismer/slpdev/src/2.2/src/Lib
Modified Files:
pickle.py
Log Message:
hopefully this is now a base version
Index: pickle.py
===================================================================
RCS file: /home/cvs/slpdev/src/2.2/src/Lib/pickle.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pickle.py 29 Nov 2003 22:06:36 -0000 1.3
--- pickle.py 1 May 2004 00:44:33 -0000 1.4
***************
*** 164,171 ****
f = self.dispatch[t]
except KeyError:
- if issubclass(t, TypeType):
- self.save_global(object)
- return
-
pid = self.inst_persistent_id(object)
if pid is not None:
--- 164,167 ----
***************
*** 174,177 ****
--- 170,181 ----
try:
+ issc = issubclass(t, TypeType)
+ except TypeError: # t is not a class
+ issc = 0
+ if issc:
+ self.save_global(object)
+ return
+
+ try:
reduce = dispatch_table[t]
except KeyError:
***************
*** 549,574 ****
! classmap = {}
! # This is no longer used to find classes, but still for functions
! def whichmodule(cls, clsname):
! """Figure out the module in which a class occurs.
Search sys.modules for the module.
Cache in classmap.
Return a module name.
! If the class cannot be found, return __main__.
"""
! if classmap.has_key(cls):
! return classmap[cls]
for name, module in sys.modules.items():
if name != '__main__' and \
! hasattr(module, clsname) and \
! getattr(module, clsname) is cls:
break
else:
name = '__main__'
! classmap[cls] = name
return name
--- 553,579 ----
! classmap = {} # called classmap for backwards compatibility
! def whichmodule(func, funcname):
! """Figure out the module in which a function occurs.
Search sys.modules for the module.
Cache in classmap.
Return a module name.
! If the function cannot be found, return __main__.
"""
! if classmap.has_key(func):
! return classmap[func]
for name, module in sys.modules.items():
+ if module is None:
+ continue # skip dummy package entries
if name != '__main__' and \
! hasattr(module, funcname) and \
! getattr(module, funcname) is func:
break
else:
name = '__main__'
! classmap[func] = name
return name
_______________________________________________
Stackless-checkins mailing list
Stackless-checkins at stackless.com
http://www.stackless.com/mailman/listinfo/stackless-checkins
- Previous message: [Stackless-checkins] CVS: slpdev/src/2.2/src/Include Python.h, 1.8, 1.9 frameobject.h, 1.21, 1.22 methodobject.h, 1.4, 1.5 object.h, 1.8, 1.9 pyerrors.h, 1.2, 1.3 pystate.h, 1.8, 1.9
- Next message: [Stackless-checkins] CVS: slpdev/src/2.2/src/Lib/email/test/data msg_21.txt, 1.1.1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Stackless-checkins
mailing list