summaryrefslogtreecommitdiffstats
path: root/Tools
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
parent2cb57a40b28f4680a1433d4640d99f4b2efe7165 (diff)
downloadcpython-38feaf0fef244879411f094a7e68f542a6771dea.zip
cpython-38feaf0fef244879411f094a7e68f542a6771dea.tar.gz
cpython-38feaf0fef244879411f094a7e68f542a6771dea.tar.bz2
#2879: rename _winreg to winreg.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/freeze/extensions_win32.ini2
-rw-r--r--Tools/msi/msilib.py8
-rw-r--r--Tools/scripts/win_add2path.py12
3 files changed, 11 insertions, 11 deletions
diff --git a/Tools/freeze/extensions_win32.ini b/Tools/freeze/extensions_win32.ini
index efc5e35..1e36aba 100644
--- a/Tools/freeze/extensions_win32.ini
+++ b/Tools/freeze/extensions_win32.ini
@@ -52,7 +52,7 @@ dsp=%PYTHONPREFIX%\PCBuild\zlib.dsp
cl=/I %PYTHONPREFIX%\..\zlib-1.1.4 /D _WINDOWS /D WIN32
libs=%PYTHONPREFIX%\..\zlib-1.1.4\zlib.lib /nodefaultlib:libc
-[_winreg]
+[winreg]
dsp=%PYTHONPREFIX%\PCBuild\winreg.dsp
libs=advapi32.lib
diff --git a/Tools/msi/msilib.py b/Tools/msi/msilib.py
index e07ef2b..8497400 100644
--- a/Tools/msi/msilib.py
+++ b/Tools/msi/msilib.py
@@ -5,7 +5,7 @@ import win32com.client.gencache
import win32com.client
import pythoncom, pywintypes
from win32com.client import constants
-import re, string, os, sets, glob, subprocess, sys, _winreg, struct
+import re, string, os, sets, glob, subprocess, sys, winreg, struct
# Partially taken from Wine
datasizemask= 0x00ff
@@ -376,9 +376,9 @@ class CAB:
(r"Software\Microsoft\Win32SDK\Directories", "Install Dir"),
]:
try:
- key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, k)
- dir = _winreg.QueryValueEx(key, v)[0]
- _winreg.CloseKey(key)
+ key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, k)
+ dir = winreg.QueryValueEx(key, v)[0]
+ winreg.CloseKey(key)
except (WindowsError, IndexError):
continue
cabarc = os.path.join(dir, r"Bin", "cabarc.exe")
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()