summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-03-31 19:04:25 (GMT)
committerGreg Ward <gward@python.net>2000-03-31 19:04:25 (GMT)
commit19ce16665dedb0fd16e2ce4ab33d4ca9af01faa9 (patch)
tree5a53e3bde76efc89efa9dcdc11f151fbfc7da76d /Lib/distutils
parentddc6c276b732c61b98bd604b2e73004b13fa5346 (diff)
downloadcpython-19ce16665dedb0fd16e2ce4ab33d4ca9af01faa9.zip
cpython-19ce16665dedb0fd16e2ce4ab33d4ca9af01faa9.tar.gz
cpython-19ce16665dedb0fd16e2ce4ab33d4ca9af01faa9.tar.bz2
Fixed my simplification to Thomas' patch: winreg and win32api export the same
functions, but with different names.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/msvccompiler.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py
index b38aadb..43a8596 100644
--- a/Lib/distutils/msvccompiler.py
+++ b/Lib/distutils/msvccompiler.py
@@ -21,15 +21,25 @@ _can_read_reg = 0
try:
import winreg
_can_read_reg = 1
- hkey_mod = winreg # module that provides HKEY_* stuff
- reg_mod = winreg # provides other registry stuff
+ hkey_mod = winreg
+
+ RegOpenKeyEx = winreg.OpenKeyEx
+ RegEnumKey = winreg.EnumKey
+ RegEnumValue = winreg.EnumValue
+ RegError = winreg.error
+
except ImportError:
try:
import win32api
import win32con
_can_read_reg = 1
hkey_mod = win32con
- reg_mod = win32api
+
+ RegOpenKeyEx = win32api.RegOpenKeyEx
+ RegEnumKey = win32api.RegEnumKey
+ RegEnumValue = win32api.RegEnumValue
+ RegError = win32api.error
+
except ImportError:
pass
@@ -38,11 +48,6 @@ if _can_read_reg:
HKEY_LOCAL_MACHINE = hkey_mod.HKEY_LOCAL_MACHINE
HKEY_CURRENT_USER = hkey_mod.HKEY_CURRENT_USER
HKEY_USERS = hkey_mod.HKEY_USERS
- RegOpenKeyEx = reg_mod.RegOpenKeyEx
- RegEnumKey = reg_mod.RegEnumKey
- RegEnumValue = reg_mod.RegEnumValue
- RegError = reg_mod.error
- _can_read_reg = 1