Commit 402c1acb authored by Jérome Perrin's avatar Jérome Perrin

BusinessTemplate: do not export PythonScripts' Script_magic

This is used to trigger recompilation of bytecode, but we don't
export the byte code so we don't need to export it.
This also prevent diffs when the Script_magic changed, like it's the
case with Products.PythonScripts 4.2 , with commit 590125a (Force
recompilation of scripts., 2017-10-23).
parent c2678853
...@@ -585,13 +585,21 @@ class BaseTemplateItem(Implicit, Persistent): ...@@ -585,13 +585,21 @@ class BaseTemplateItem(Implicit, Persistent):
# PythonScript covers both Zope Python scripts # PythonScript covers both Zope Python scripts
# and ERP5 Python Scripts # and ERP5 Python Scripts
if isinstance(obj, PythonScript): if isinstance(obj, PythonScript):
# `expression_instance` is included so as to add compatibility for attr_set.update(
# exporting older catalog methods which might have them as their (
# properties or in their attribute dict. '__code__',
attr_set.update(('func_code', '__code__', 'func_code',
'func_defaults', '__defaults__', '__defaults__',
'_code', '_lazy_compilation', 'Python_magic', 'func_defaults',
'expression_instance')) '_code',
'_lazy_compilation',
'Python_magic',
'Script_magic',
# `expression_instance` is included so as to add compatibility for
# exporting older catalog methods which might have them as their
# properties or in their attribute dict.
'expression_instance',
))
for attr in 'errors', 'warnings', '_proxy_roles': for attr in 'errors', 'warnings', '_proxy_roles':
if not obj.__dict__.get(attr, 1): if not obj.__dict__.get(attr, 1):
delattr(obj, attr) delattr(obj, attr)
......
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