Commit 6bc77078 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 0fbc3f6c
...@@ -594,13 +594,21 @@ class BaseTemplateItem(Implicit, Persistent): ...@@ -594,13 +594,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):
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 # `expression_instance` is included so as to add compatibility for
# exporting older catalog methods which might have them as their # exporting older catalog methods which might have them as their
# properties or in their attribute dict. # properties or in their attribute dict.
attr_set.update(('func_code', '__code__', 'expression_instance',
'func_defaults', '__defaults__', ))
'_code', '_lazy_compilation', 'Python_magic',
'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