ztfy/utils/request.py
branchZTK-1.1
changeset 114 2a06052933cb
parent 92 bf59a3d6e437
--- a/ztfy/utils/request.py	Sat Feb 04 09:25:21 2012 +0100
+++ b/ztfy/utils/request.py	Mon Mar 05 08:27:00 2012 +0100
@@ -17,8 +17,9 @@
 # import standard packages
 
 # import Zope3 interfaces
+from zope.annotation.interfaces import IAnnotations
 from zope.publisher.interfaces import IRequest
-from zope.annotation.interfaces import IAnnotations
+from zope.security.interfaces import NoInteraction
 
 # import local interfaces
 
@@ -28,7 +29,6 @@
 # import local packages
 
 from ztfy.utils import _
-from zope.security.interfaces import NoInteraction
 
 
 def getRequest():
@@ -43,7 +43,9 @@
 def queryRequest():
     try:
         return getRequest()
-    except NoInteraction:
+    except NoInteraction:  # No current interaction
+        return None
+    except RuntimeError:   # No request in interaction
         return None