# HG changeset patch # User Thierry Florac # Date 1330932420 -3600 # Node ID 2a06052933cb97a2136362c901111c254f41d95c # Parent 6e4902ab865fb908b34f6cbd18ebb6218bdc2ff8 Added handling of runtime exception diff -r 6e4902ab865f -r 2a06052933cb ztfy/utils/request.py --- 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