[Modeling-cvs] SF.net SVN: modeling: [980] trunk/ProjectModeling/Modeling/utils.py
Status: Abandoned
Brought to you by:
sbigaret
From: <sbi...@us...> - 2006-02-26 18:04:55
|
Revision: 980 Author: sbigaret Date: 2006-02-26 10:04:47 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=980&view=rev Log Message: ----------- 2nd part of the fix for bug #918115 Modified Paths: -------------- trunk/ProjectModeling/Modeling/utils.py Modified: trunk/ProjectModeling/Modeling/utils.py =================================================================== --- trunk/ProjectModeling/Modeling/utils.py 2006-02-26 17:50:55 UTC (rev 979) +++ trunk/ProjectModeling/Modeling/utils.py 2006-02-26 18:04:47 UTC (rev 980) @@ -202,6 +202,10 @@ substituting the method with a lambda returning the value the original method returned. + This method does nothing under python v2.1 if ZODB is found in the path, + because it is incompatible with the extension class, used by classes Entity, + Relationship, etc. + Parameters: anInstance -- the instance to examine @@ -210,9 +214,14 @@ See also: methods_to_cache() """ - import os + import os, sys if not os.environ.get('MDL_ENABLE_SIMPLE_METHOD_CACHE', None): return + + if sys.version_info < (2,2): + import warnings + warnings.warn("Cannot cache methods on py2.1 when ZODB is in the python path", RuntimeWarning) + return from new import instancemethod for m in methods_to_cache(anInstance.__class__, exclude): try: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |