summaryrefslogtreecommitdiff
path: root/fs/path.py
diff options
context:
space:
mode:
Diffstat (limited to 'fs/path.py')
-rw-r--r--fs/path.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/path.py b/fs/path.py
index 8f9f819..4378229 100644
--- a/fs/path.py
+++ b/fs/path.py
@@ -46,7 +46,8 @@ def normpath(path):
if not _requires_normalization(path):
return path.rstrip('/')
- components = [''] if path.startswith('/') else []
+ prefix = u'/' if path.startswith('/') else u''
+ components = []
append = components.append
special = ('..', '.', '').__contains__
try:
@@ -61,7 +62,7 @@ def normpath(path):
# causing a circular import.
from fs.errors import BackReferenceError
raise BackReferenceError('Too many backrefs in \'%s\'' % path)
- return u'/'.join(components)
+ return prefix + u'/'.join(components)
if os.sep != '/':