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):
# PythonScript covers both Zope Python scripts
# and ERP5 Python Scripts
if isinstance(obj, PythonScript):
# `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.
attr_set.update(('func_code', '__code__',
'func_defaults', '__defaults__',
'_code', '_lazy_compilation', 'Python_magic',
'expression_instance'))
attr_set.update(
(
'__code__',
'func_code',
'__defaults__',
'func_defaults',
'_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':
if not obj.__dict__.get(attr, 1):
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