[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/traversing/namespace.py
Only allow ++debug++ in debug mode (i.e. python -O disables it).
Marius Gedminas
marius at pov.lt
Fri Jun 11 13:53:14 EDT 2004
Log message for revision 25362:
Only allow ++debug++ in debug mode (i.e. python -O disables it).
-=-
Modified: Zope3/trunk/src/zope/app/traversing/namespace.py
===================================================================
--- Zope3/trunk/src/zope/app/traversing/namespace.py 2004-06-11 17:52:57 UTC (rev 25361)
+++ Zope3/trunk/src/zope/app/traversing/namespace.py 2004-06-11 17:53:13 UTC (rev 25362)
@@ -463,11 +463,14 @@
unknown debugging flag
"""
- request = self.request
- for flag in name.split(','):
- if flag == 'source':
- request.debug.sourceAnnotations = True
- else:
- raise ValueError("Unknown debug flag: %s" % flag)
- return self.context
+ if __debug__:
+ request = self.request
+ for flag in name.split(','):
+ if flag == 'source':
+ request.debug.sourceAnnotations = True
+ else:
+ raise ValueError("Unknown debug flag: %s" % flag)
+ return self.context
+ else:
+ raise ValueError("Debug flags only allowed in debug mode")
More information about the Zope3-Checkins
mailing list