summaryrefslogtreecommitdiff
path: root/Lib/ntpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r--Lib/ntpath.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index b32ec164bb..23d5127809 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -344,8 +344,10 @@ def expandvars(path):
var = path[:index]
if var in os.environ:
res = res + os.environ[var]
+ else:
+ res = res + '${' + var + '}'
except ValueError:
- res = res + path
+ res = res + '${' + path
index = pathlen - 1
else:
var = ''
@@ -357,8 +359,10 @@ def expandvars(path):
c = path[index:index + 1]
if var in os.environ:
res = res + os.environ[var]
+ else:
+ res = res + '$' + var
if c != '':
- res = res + c
+ index = index - 1
else:
res = res + c
index = index + 1