Commit 8d42fd02 authored by Jérome Perrin's avatar Jérome Perrin

patches: make Shared.DC.Scripts.Bindings a new style class

This backports parts of zope commit bb7837c66 (Explicitly make all
classes new-style., 2017-09-15) and 173658008 (Fix unpickling of instances
those base class changed to a new-style class. (#208), 2017-10-24),
so that business template is same between zope4 and zope2 and so that
business templates created with zope4 can still be installed on zope2.
parent 9c2bfa32
......@@ -99,6 +99,7 @@ from Products.ERP5Type.patches import users
from Products.ERP5Type.patches import Publish
from Products.ERP5Type.patches import WSGITask
from Products.ERP5Type.patches import urllib_opener
from Products.ERP5Type.patches import SharedDCScriptsBindings
# These symbols are required for backward compatibility
from Products.ERP5Type.patches.PropertyManager import ERP5PropertyManager
......
import Shared.DC.Scripts.Bindings
# Make Shared.DC.Scripts.Bindings a new style classes already on Zope2, so that
# we can install business templates exported on Zope4 in Zope2 instances.
_NameAssignments = Shared.DC.Scripts.Bindings.NameAssignments
if not isinstance(_NameAssignments, type):
class NameAssignments(_NameAssignments, object):
def __init__(self, mapping=None):
if mapping is None:
mapping = {}
_NameAssignments.__init__(self, mapping)
NameAssignments.__module__ = _NameAssignments.__module__
Shared.DC.Scripts.Bindings.NameAssignments = NameAssignments
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