[Zope3-checkins] SVN: Zope3/trunk/src/zope/security/checker.py Fix Python 2.4 compatibility.

Fred L. Drake, Jr. fred at zope.com
Wed Jun 23 16:25:59 EDT 2004


Log message for revision 25962:
Fix Python 2.4 compatibility.
Merged from revision 25958 on the ZopeX3-3.0 branch.

While Python 2.3 used a single iterator type to support iteration over
dictionaries, Python 2.4 uses different types to support items, keys,
and values iterations.  We need to make sure declarations are made for
all of these types.



-=-
Modified: Zope3/trunk/src/zope/security/checker.py
===================================================================
--- Zope3/trunk/src/zope/security/checker.py	2004-06-23 19:39:08 UTC (rev 25961)
+++ Zope3/trunk/src/zope/security/checker.py	2004-06-23 20:25:59 UTC (rev 25962)
@@ -620,6 +620,9 @@
     type(iter([])): _iteratorChecker, # Same types in Python 2.2.1,
     type(iter(())): _iteratorChecker, # different in Python 2.3.
     type(iter({})): _iteratorChecker,
+    type({}.iteritems()): _iteratorChecker,
+    type({}.iterkeys()): _iteratorChecker,
+    type({}.itervalues()): _iteratorChecker,
     type(iter(_Sequence())): _iteratorChecker,
     type(f()): _iteratorChecker,
     type(Interface): InterfaceChecker(



More information about the Zope3-Checkins mailing list