summaryrefslogtreecommitdiff
path: root/repoze/bfg/traversal.py
diff options
context:
space:
mode:
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