Commit 6e6ef31d authored by Nicolas Dumazet's avatar Nicolas Dumazet

do not override ghostbase if it's already set.

It can happen in recursive calls to loadClass, when generating accessor holders:
innermost call will return from getPortalTypeClass, will save the ghost base.
And then, when outer calls return as well, they need not save the ghost.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40202 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2e286e4a
......@@ -136,7 +136,11 @@ class PortalTypeMetaClass(ExtensionClass):
# save the old bases to be able to restore a ghost state later
klass.__ghostbase__ = klass.__bases__
if not hasattr(klass, '__ghostbase__'):
# but only do it if we're in the innermost call, otherwise
# klass.__bases__ might just be the Document without accessor
# holders, and we would override the real ghost class
klass.__ghostbase__ = klass.__bases__
klass.__bases__ = base_list
for key, value in attribute_dict.iteritems():
......
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