[Python-checkins] r70943 - in python/branches/py3k: Lib/distutils/tests/test_msvc9compiler.py Lib/urllib/request.py Misc/NEWS Tools/msi/msilib.py

georg.brandl python-checkins at python.org
Wed Apr 1 06:28:33 CEST 2009


Author: georg.brandl
Date: Wed Apr  1 06:28:33 2009
New Revision: 70943

Log:
Merged revisions 70940 via svnmerge

........
  r70940 | georg.brandl | 2009-03-31 23:21:14 -0500 (Di, 31 Mär 2009) | 2 lines
  
  The SimpleXMLRPCServer's CGI handler now runs like a pony.
........


Modified:
   python/branches/py3k/Lib/distutils/tests/test_msvc9compiler.py
   python/branches/py3k/Lib/urllib/request.py
   python/branches/py3k/Misc/NEWS
   python/branches/py3k/Tools/msi/msilib.py

Modified: python/branches/py3k/Lib/distutils/tests/test_msvc9compiler.py
==============================================================================
--- python/branches/py3k/Lib/distutils/tests/test_msvc9compiler.py	(original)
+++ python/branches/py3k/Lib/distutils/tests/test_msvc9compiler.py	Wed Apr  1 06:28:33 2009
@@ -48,8 +48,8 @@
         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)
 

Modified: python/branches/py3k/Lib/urllib/request.py
==============================================================================
--- python/branches/py3k/Lib/urllib/request.py	(original)
+++ python/branches/py3k/Lib/urllib/request.py	Wed Apr  1 06:28:33 2009
@@ -2160,18 +2160,18 @@
         """
         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 @@
 
     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:

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Wed Apr  1 06:28:33 2009
@@ -53,6 +53,8 @@
 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

Modified: python/branches/py3k/Tools/msi/msilib.py
==============================================================================
--- python/branches/py3k/Tools/msi/msilib.py	(original)
+++ python/branches/py3k/Tools/msi/msilib.py	Wed Apr  1 06:28:33 2009
@@ -5,7 +5,7 @@
 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 @@
                      (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")


More information about the Python-checkins mailing list