[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/exceptions/__init__.py Don't depend on spelling of ImportError messages.

Tres Seaver tseaver at palladion.com
Tue Apr 4 17:51:38 EDT 2006


Log message for revision 66453:
  Don't depend on spelling of ImportError messages.

Changed:
  U   Zope3/branches/ZopeX3-3.0/src/zope/exceptions/__init__.py

-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/exceptions/__init__.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/exceptions/__init__.py	2006-04-04 21:30:05 UTC (rev 66452)
+++ Zope3/branches/ZopeX3-3.0/src/zope/exceptions/__init__.py	2006-04-04 21:51:37 UTC (rev 66453)
@@ -24,13 +24,13 @@
 
 # Importing these interfaces from here is deprecated!
 
-# avoid depency on zope.security:
+# avoid hard depency on zope.security:
 try:
-    import zope.security
-except ImportError, v:
-    if not str(v).endswith(' zope.security'):
-        raise
-else:    
-    from zope.security.interfaces import IUnauthorized, Unauthorized
-    from zope.security.interfaces import IForbidden, IForbiddenAttribute
-    from zope.security.interfaces import Forbidden, ForbiddenAttribute
+    from zope.security.interfaces import IUnauthorized
+    from zope.security.interfaces import Unauthorized
+    from zope.security.interfaces import IForbidden
+    from zope.security.interfaces import Forbidden
+    from zope.security.interfaces import IForbiddenAttribute
+    from zope.security.interfaces import ForbiddenAttribute
+except ImportError:
+    pass



More information about the Zope3-Checkins mailing list