Commit f1f3c24a authored by Yoshinori Okuji's avatar Yoshinori Okuji

Use the original _compile against FSPythonScript.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17430 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a7bda784
...@@ -763,11 +763,12 @@ def optimize(): ...@@ -763,11 +763,12 @@ 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
# 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 from Products.CMFCore.FSPythonScript import FSPythonScript
FSPythonScript_write = FSPythonScript._write FSPythonScript._compile = PythonScript_compile
def _write(self, text, compile):
return FSPythonScript_write(self, text, 0)
FSPythonScript._write = _write
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