def _doregister(mod_name, dll_name):
assert os.path.isfile(dll_name), "Shouldn't get here if the file doesn't exist!"
try:
key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "Software\\Python\\PythonCore\\%s\\Modules\\%s" % (sys.winver, mod_name))
except _winreg.error:
try:
key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "Software\\Python\\PythonCore\\%s\\Modules\\%s" % (sys.winver, mod_name))
except _winreg.error:
print "Could not find the existing '%s' module registered in the registry" % (mod_name,)
usage_and_die(4)
# Create the debug key.
sub_key = _winreg.CreateKey(key, "Debug")
_winreg.SetValue(sub_key, None, _winreg.REG_SZ, dll_name)
print "Registered '%s' in the registry" % (dll_name,)
评论列表
文章目录