[Zope-Checkins] SVN: Zope/trunk/ Use `in` operator instead of deprecated `has_key`.

Malthe Borch mborch at gmail.com
Wed Dec 14 14:44:09 UTC 2011


Log message for revision 123811:
  Use `in` operator instead of deprecated `has_key`.

Changed:
  U   Zope/trunk/doc/CHANGES.rst
  U   Zope/trunk/src/ZPublisher/BaseRequest.py

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst	2011-12-13 22:23:14 UTC (rev 123810)
+++ Zope/trunk/doc/CHANGES.rst	2011-12-14 14:44:06 UTC (rev 123811)
@@ -11,6 +11,10 @@
 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).
 

Modified: Zope/trunk/src/ZPublisher/BaseRequest.py
===================================================================
--- Zope/trunk/src/ZPublisher/BaseRequest.py	2011-12-13 22:23:14 UTC (rev 123810)
+++ Zope/trunk/src/ZPublisher/BaseRequest.py	2011-12-14 14:44:06 UTC (rev 123811)
@@ -540,9 +540,9 @@
         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



More information about the Zope-Checkins mailing list