Skip to content

Commit

Permalink
- restore original control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Nov 23, 2019
1 parent 5b7f050 commit 2aedb83
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/OFS/Traversable.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,19 @@ def unrestrictedTraverse(self, path, default=_marker, restricted=False):
validated with the security machinery. Usually invoked using
restrictedTraverse().
"""
if path:
if isinstance(path, str):
path = path.split('/')
else:
path = list(path)
for part in path:
if not isinstance(part, str):
raise TypeError(
"path should be a string or an iterable of strings"
)

if not path:
return self

if isinstance(path, str):
path = path.split('/')
else:
path = list(path)
for part in path:
if not isinstance(part, str):
raise TypeError(
"path should be a string or an iterable of strings"
)

REQUEST = {'TraversalRequestNameStack': path}
path.reverse()
path_pop = path.pop
Expand Down

0 comments on commit 2aedb83

Please sign in to comment.