summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-04-01 04:28:33 (GMT)
committerGeorg Brandl <georg@python.org>2009-04-01 04:28:33 (GMT)
commit4ed72acd68a1a1d90946e189c94b7d656719da45 (patch)
tree37afeb94df477404291adfa1742f22cd7b39fb6f
parent99412e559bea9179394366a95ae1a2c1b0723c47 (diff)
downloadcpython-4ed72acd68a1a1d90946e189c94b7d656719da45.zip
cpython-4ed72acd68a1a1d90946e189c94b7d656719da45.tar.gz
cpython-4ed72acd68a1a1d90946e189c94b7d656719da45.tar.bz2
#5624: _winreg is winreg in Python 3.
-rw-r--r--Lib/distutils/tests/test_msvc9compiler.py4
-rw-r--r--Lib/urllib/request.py16
-rw-r--r--Misc/NEWS2
-rw-r--r--Tools/msi/msilib.py8
4 files changed, 16 insertions, 14 deletions
diff --git a/Lib/distutils/tests/test_msvc9compiler.py b/Lib/distutils/tests/test_msvc9compiler.py
index aefadd6..11e5a47 100644
--- a/Lib/distutils/tests/test_msvc9compiler.py
+++ b/Lib/distutils/tests/test_msvc9compiler.py
@@ -48,8 +48,8 @@ class msvc9compilerTestCase(unittest.TestCase):
v = Reg.get_value(path, "lfitalic")
self.assert_(v in (0, 1))
- import _winreg
- HKCU = _winreg.HKEY_CURRENT_USER
+ import winreg
+ HKCU = winreg.HKEY_CURRENT_USER
keys = Reg.read_keys(HKCU, 'xxxx')
self.assertEquals(keys, None)
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 3e5b05c..59ec7b8 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -2160,18 +2160,18 @@ elif os.name == 'nt':
"""
proxies = {}
try:
- import _winreg
+ import winreg
except ImportError:
# Std module, so should be around - but you never know!
return proxies
try:
- internetSettings = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
+ internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
r'Software\Microsoft\Windows\CurrentVersion\Internet Settings')
- proxyEnable = _winreg.QueryValueEx(internetSettings,
+ proxyEnable = winreg.QueryValueEx(internetSettings,
'ProxyEnable')[0]
if proxyEnable:
# Returned as Unicode but problems if not converted to ASCII
- proxyServer = str(_winreg.QueryValueEx(internetSettings,
+ proxyServer = str(winreg.QueryValueEx(internetSettings,
'ProxyServer')[0])
if '=' in proxyServer:
# Per-protocol settings
@@ -2208,17 +2208,17 @@ elif os.name == 'nt':
def proxy_bypass_registry(host):
try:
- import _winreg
+ import winreg
import re
except ImportError:
# Std modules, so should be around - but you never know!
return 0
try:
- internetSettings = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
+ internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
r'Software\Microsoft\Windows\CurrentVersion\Internet Settings')
- proxyEnable = _winreg.QueryValueEx(internetSettings,
+ proxyEnable = winreg.QueryValueEx(internetSettings,
'ProxyEnable')[0]
- proxyOverride = str(_winreg.QueryValueEx(internetSettings,
+ proxyOverride = str(winreg.QueryValueEx(internetSettings,
'ProxyOverride')[0])
# ^^^^ Returned as Unicode but problems if not converted to ASCII
except WindowsError:
diff --git a/Misc/NEWS b/Misc/NEWS
index ce0db2a..4a90ba5 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -53,6 +53,8 @@ Core and Builtins
Library
-------
+- Issue #5624: Fix the _winreg module name still used in several modules.
+
- Issue #5628: Fix io.TextIOWrapper.read() with a unreadable buffer.
- Issue #5619: Multiprocessing children disobey the debug flag and causes
diff --git a/Tools/msi/msilib.py b/Tools/msi/msilib.py
index 6f49b4c..23a40a0 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
try:
basestring
@@ -387,9 +387,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")