You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by nl...@apache.org on 2006/02/02 08:59:28 UTC
svn commit: r374295 -
/httpd/mod_python/trunk/lib/python/mod_python/publisher.py
Author: nlehuen
Date: Wed Feb 1 23:59:26 2006
New Revision: 374295
URL: http://svn.apache.org/viewcvs?rev=374295&view=rev
Log:
We don't need no stinkin' enumerate.
Modified:
httpd/mod_python/trunk/lib/python/mod_python/publisher.py
Modified: httpd/mod_python/trunk/lib/python/mod_python/publisher.py
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/lib/python/mod_python/publisher.py?rev=374295&r1=374294&r2=374295&view=diff
==============================================================================
--- httpd/mod_python/trunk/lib/python/mod_python/publisher.py (original)
+++ httpd/mod_python/trunk/lib/python/mod_python/publisher.py Wed Feb 1 23:59:26 2006
@@ -353,8 +353,9 @@
(period) to find the last one we're looking for.
"""
parts = object_str.split('.')
-
- for i, obj_str in enumerate(parts):
+
+ first_object = True
+ for obj_str in parts:
# path components starting with an underscore are forbidden
if obj_str[0]=='_':
req.log_error('Cannot traverse %s in %s because '
@@ -362,9 +363,10 @@
% (obj_str, req.unparsed_uri), apache.APLOG_WARNING)
raise apache.SERVER_RETURN, apache.HTTP_FORBIDDEN
- # if we're not in the first object (which is the module)
- if i>0:
-
+ if first_object:
+ first_object = False
+ else:
+ # if we're not in the first object (which is the module)
# we're going to check whether be can traverse this type or not
rule = tp_rules.get(type(obj), default_tp_rule)
if not rule[0]: