Commit 4b10648f authored by Yoshinori Okuji's avatar Yoshinori Okuji

_makeFunction needs to compile a script immediately.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17540 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5040c9e7
......@@ -772,12 +772,14 @@ def optimize():
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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment