[Zope3-checkins] CVS: Zope3/src/zope/security - checker.py:1.35
Jeremy Hylton
jeremy@zope.com
Sun, 22 Jun 2003 16:40:11 -0400
Update of /cvs-repository/Zope3/src/zope/security
In directory cvs.zope.org:/tmp/cvs-serv21316/src/zope/security
Modified Files:
checker.py
Log Message:
Add security declarations for generators.
=== Zope3/src/zope/security/checker.py 1.34 => 1.35 ===
--- Zope3/src/zope/security/checker.py:1.34 Fri Jun 20 02:40:12 2003
+++ Zope3/src/zope/security/checker.py Sun Jun 22 16:40:11 2003
@@ -21,6 +21,7 @@
forbidden attribute access. Setting it to a larger number will also display
messages about granted attribute access.
"""
+from __future__ import generators
import os
import sys
@@ -698,6 +699,10 @@
_InterfaceSpecification_checker = InterfaceChecker(IInterfaceSpecification)
+def f():
+ yield f
+
+
_default_checkers = {
dict: NamesChecker(['__getitem__', '__len__', '__iter__',
'get', 'has_key', 'copy', '__str__', 'keys',
@@ -725,6 +730,7 @@
type(iter(())): _iteratorChecker, # different in Python 2.3.
type(iter({})): _iteratorChecker,
type(iter(_Sequence())): _iteratorChecker,
+ type(f()): _iteratorChecker,
type(Interface): InterfaceChecker(IInterface, __str__=CheckerPublic),
ObjectSpecification: _InterfaceSpecification_checker,
ProvidesSpecification: _InterfaceSpecification_checker,