summaryrefslogtreecommitdiff
path: root/repoze/bfg/traversal.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-01-28 11:57:17 +0000
committerChris McDonough <chrism@agendaless.com>2009-01-28 11:57:17 +0000
commit812371007f53fdda6b428a4e9349df1b69fcd235 (patch)
tree6f42de2196af78e57cb42055972bc4bd9f35b9f7 /repoze/bfg/traversal.py
parent70cc2047b8bb358a8418c11ec0d39d09120ffd3c (diff)
downloadpyramid-812371007f53fdda6b428a4e9349df1b69fcd235.tar.gz
pyramid-812371007f53fdda6b428a4e9349df1b69fcd235.tar.bz2
pyramid-812371007f53fdda6b428a4e9349df1b69fcd235.zip
Use lstrip and rstrip; traverser now has no "locatable".
Diffstat (limited to 'repoze/bfg/traversal.py')
-rw-r--r--repoze/bfg/traversal.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/repoze/bfg/traversal.py b/repoze/bfg/traversal.py
index 4c9f5dfb2..f43935ff4 100644
--- a/repoze/bfg/traversal.py
+++ b/repoze/bfg/traversal.py
@@ -194,10 +194,8 @@ def traversal_path(path):
(u'archives', u'<unprintable unicode>')
"""
- while path.startswith('/'):
- path = path[1:]
- while path.endswith('/'):
- path = path[:-1]
+ path = path.rstrip('/')
+ path = path.lstrip('/')
clean = []
for segment in path.split('/'):
segment = urllib.unquote(segment) # deal with spaces in path segment