|
[Webware-checkins] CVS: Webware/MiddleKit/Core Model.py,1.15,1.16
From: Chuck Esterbrook <echuck@us...> - 2002-11-11 03:52
|
Update of /cvsroot/webware/Webware/MiddleKit/Core
In directory usw-pr-cvs1:/tmp/cvs-serv1011/Core
Modified Files:
Model.py
Log Message:
- require Python 2.2 or greater for pickle caching, otherwise
this happens: cPickle.UnpickleableError: Cannot pickle <type 'type'>
Index: Model.py
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Core/Model.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Model.py 11 Nov 2002 02:19:25 -0000 1.15
--- Model.py 11 Nov 2002 03:52:47 -0000 1.16
***************
*** 8,11 ****
--- 8,13 ----
from pickle import load, dump
+ havePython22OrGreater = sys.version_info[0]>2 or (sys.version_info[0]==2 and sys.version_info[1]>=2)
+
class Model(Configurable):
***************
*** 75,79 ****
# read the pickled version of Classes if possible
data = None
! shouldUseCache = self.setting('UsePickledClassesCache', 1)
if shouldUseCache:
from MiscUtils.PickleCache import readPickleCache, writePickleCache
--- 77,83 ----
# read the pickled version of Classes if possible
data = None
! shouldUseCache = self.setting('UsePickledClassesCache', 1) and havePython22OrGreater
! # ^ require Python 2.2 or greater.
! # otherwise we get cPickle.UnpickleableError: Cannot pickle <type 'type'> objects
if shouldUseCache:
from MiscUtils.PickleCache import readPickleCache, writePickleCache
|
| Thread | Author | Date |
|---|---|---|
| [Webware-checkins] CVS: Webware/MiddleKit/Core Model.py,1.15,1.16 | Chuck Esterbrook <echuck@us...> |