[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Security - _protections.py:1.8

Jeremy Hylton jeremy@zope.com
Fri, 20 Dec 2002 14:11:29 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv8708/App/Security

Modified Files:
	_protections.py 
Log Message:
Fix for Python 2.3.

In Python 2.3 and up, PersistentMetaClass is just type.
It causes an error to define a new checker for type.


=== Zope3/lib/python/Zope/App/Security/_protections.py 1.7 => 1.8 ===
--- Zope3/lib/python/Zope/App/Security/_protections.py:1.7	Fri Dec 20 06:11:37 2002
+++ Zope3/lib/python/Zope/App/Security/_protections.py	Fri Dec 20 14:11:29 2002
@@ -101,6 +101,10 @@
                         ]
                      )
                   )
+
+    # In Python 2.3 and up, PersistentMetaClass is just type.
+    # It causes an error to define a new checker for type.
     from Persistence import PersistentMetaClass
-    from Zope.Security.Checker import _typeChecker
-    defineChecker(PersistentMetaClass, _typeChecker)
+    if PersistentMetaClass != type:
+        from Zope.Security.Checker import _typeChecker
+        defineChecker(PersistentMetaClass, _typeChecker)