Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zope4 #13

Merged
merged 2 commits into from
Feb 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ New:

Fixes:

- *add item here*
- Add temporary fix for a test failure within a Zope 4 environment.
[pbauer]


1.2.6 (2014-10-20)
Expand Down
20 changes: 17 additions & 3 deletions plone/supermodel/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,23 @@ def finalizeSchemas(parent=Schema):

def walk(schema):
yield schema
for child in schema.dependents.keys():
for s in walk(child):
yield s
if getattr(schema, 'dependents', None) is None:
# This is just a temporary fix for a issue when running Plone-tests
# with zope4 (http://jenkins.plone.org/view/PLIPs/job/plip-zope4/).
# InterfaceClass
# plone.dexterity.schema.generated.plone_0_LockableType
# has zope.interface.adapter.VerifyingAdapterLookup as a
# dependent which again has no dependents.
# Maybe VerifyingAdapterLookup should not be here or it should have
# dependents (a weakref.WeakKeyDictionary())
# Maybe also related to the comment below which states that the
# first base class of a schema must be a SchemaClass.
logger.info(
'This should not happen: "%s" has no dependents!' % schema)
else:
for child in schema.dependents.keys():
for s in walk(child):
yield s
schemas = set(walk(parent))
for schema in schemas:
if hasattr(schema, '_SchemaClass_finalize'):
Expand Down