Skip to content

Commit

Permalink
Use in operator instead of deprecated has_key.
Browse files Browse the repository at this point in the history
  • Loading branch information
malthe committed Dec 14, 2011
1 parent f486213 commit a76d48b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions doc/CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed
++++++++++

- Use ``in`` operator instead of deprecated ``has_key`` method (which
is not implemented by ``OFS.ObjectManager``). This fixes an issue
with WebDAV requests for skin objects.

- Avoid conflicting signal registrations when run under mod_wsgi.
Allows the use of `WSGIRestrictSignal Off` (LP #681853).

Expand Down
6 changes: 3 additions & 3 deletions src/ZPublisher/BaseRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,9 @@ def traverse(self, path, response=None, validated_hook=None):
if (no_acquire_flag and
hasattr(parents[1], 'aq_base') and
not hasattr(parents[1],'__bobo_traverse__')):
if not (hasattr(parents[1].aq_base, entry_name) or
parents[1].aq_base.has_key(entry_name)):
raise AttributeError, entry_name
base = parents[-1].aq_base
if not (hasattr(base, entry_name) or entry_name in base):
raise AttributeError(entry_name)

# After traversal post traversal hooks aren't available anymore
del self._post_traverse
Expand Down

0 comments on commit a76d48b

Please sign in to comment.