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(): ...@@ -772,12 +772,14 @@ def optimize():
PythonScript_compile(self) PythonScript_compile(self)
return PythonScript_exec(self, *args) return PythonScript_exec(self, *args)
PythonScript._exec = _exec PythonScript._exec = _exec
# Filesystem Python Script inherits from PythonScript, but from Acquisition import aq_parent
# the behavior is a bit inconsistent, and hard to override def _makeFunction(self, dummy=0): # CMFCore.FSPythonScript uses dummy arg.
# correctly. So just get back the original _compile. Note self.ZCacheable_invalidate()
# that _exec is overridden, so no need to recover. PythonScript_compile(self)
from Products.CMFCore.FSPythonScript import FSPythonScript if not (aq_parent(self) is None or hasattr(self, '_filepath')):
FSPythonScript._compile = PythonScript_compile # It needs a _filepath, and has an acquisition wrapper.
self._filepath = self.get_filepath()
PythonScript._makeFunction = _makeFunction
optimize() 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