summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/win_add2path.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-25 07:45:51 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-25 07:45:51 (GMT)
commit38feaf0fef244879411f094a7e68f542a6771dea (patch)
tree632d870bad650ece1724111091a2b307759ea997 /Tools/scripts/win_add2path.py
parent2cb57a40b28f4680a1433d4640d99f4b2efe7165 (diff)
downloadcpython-38feaf0fef244879411f094a7e68f542a6771dea.zip
cpython-38feaf0fef244879411f094a7e68f542a6771dea.tar.gz
cpython-38feaf0fef244879411f094a7e68f542a6771dea.tar.bz2
#2879: rename _winreg to winreg.
Diffstat (limited to 'Tools/scripts/win_add2path.py')
-rw-r--r--Tools/scripts/win_add2path.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Tools/scripts/win_add2path.py b/Tools/scripts/win_add2path.py
index 876bfb2..c4f481f 100644
--- a/Tools/scripts/win_add2path.py
+++ b/Tools/scripts/win_add2path.py
@@ -10,9 +10,9 @@ Licensed to PSF under a Contributor Agreement.
import sys
import site
import os
-import _winreg
+import winreg
-HKCU = _winreg.HKEY_CURRENT_USER
+HKCU = winreg.HKEY_CURRENT_USER
ENV = "Environment"
PATH = "PATH"
DEFAULT = u"%PATH%"
@@ -27,9 +27,9 @@ def modify():
else:
userscripts = None
- with _winreg.CreateKey(HKCU, ENV) as key:
+ with winreg.CreateKey(HKCU, ENV) as key:
try:
- envpath = _winreg.QueryValueEx(key, PATH)[0]
+ envpath = winreg.QueryValueEx(key, PATH)[0]
except WindowsError:
envpath = DEFAULT
@@ -39,7 +39,7 @@ def modify():
paths.append(path)
envpath = os.pathsep.join(paths)
- _winreg.SetValueEx(key, PATH, 0, _winreg.REG_EXPAND_SZ, envpath)
+ winreg.SetValueEx(key, PATH, 0, winreg.REG_EXPAND_SZ, envpath)
return paths, envpath
def main():
@@ -51,7 +51,7 @@ def main():
print "No path was added"
print "\nPATH is now:\n%s\n" % envpath
print "Expanded:"
- print _winreg.ExpandEnvironmentStrings(envpath)
+ print winreg.ExpandEnvironmentStrings(envpath)
if __name__ == '__main__':
main()