[Erp5-report] r17540 - /erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Nov 12 18:18:50 CET 2007


Author: yo
Date: Mon Nov 12 18:18:50 2007
New Revision: 17540

URL: http://svn.erp5.org?rev=17540&view=rev
Log:
_makeFunction needs to compile a script immediately.

Modified:
    erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py

Modified: erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py?rev=17540&r1=17539&r2=17540&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py (original)
+++ erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py Mon Nov 12 18:18:50 2007
@@ -772,12 +772,14 @@
       PythonScript_compile(self)
     return PythonScript_exec(self, *args)
   PythonScript._exec = _exec
-  # Filesystem Python Script inherits from PythonScript, but
-  # the behavior is a bit inconsistent, and hard to override
-  # correctly. So just get back the original _compile. Note
-  # that _exec is overridden, so no need to recover.
-  from Products.CMFCore.FSPythonScript import FSPythonScript
-  FSPythonScript._compile = PythonScript_compile
+  from Acquisition import aq_parent
+  def _makeFunction(self, dummy=0): # CMFCore.FSPythonScript uses dummy arg.
+    self.ZCacheable_invalidate()
+    PythonScript_compile(self)
+    if not (aq_parent(self) is None or hasattr(self, '_filepath')):
+      # It needs a _filepath, and has an acquisition wrapper.
+      self._filepath = self.get_filepath()
+  PythonScript._makeFunction = _makeFunction
 
 optimize()
 




More information about the Erp5-report mailing list