diff options
author | Thomas Heller <theller@ctypes.org> | 2002-11-26 08:05:09 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2002-11-26 08:05:09 (GMT) |
commit | 8af41ceece953bfb4f1d84d3fc11435a3edbb1d8 (patch) | |
tree | ab02200963c6faa101d45a6edc4a354c26eb3e35 | |
parent | cef3288247bef7d9cf117e611b87e76e8d70eac5 (diff) | |
download | cpython-8af41ceece953bfb4f1d84d3fc11435a3edbb1d8.zip cpython-8af41ceece953bfb4f1d84d3fc11435a3edbb1d8.tar.gz cpython-8af41ceece953bfb4f1d84d3fc11435a3edbb1d8.tar.bz2 |
Don't look for modules in the registry any longer.
Mark writes in private email:
"Modules listed in the registry was a dumb idea. This whole scheme
can die. AFAIK, no one in the world uses it (including win32all
since the last build)."
(See also SF #643711)
-rw-r--r-- | Tools/freeze/modulefinder.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/Tools/freeze/modulefinder.py b/Tools/freeze/modulefinder.py index 48f2eca..d38c9c6 100644 --- a/Tools/freeze/modulefinder.py +++ b/Tools/freeze/modulefinder.py @@ -59,39 +59,6 @@ class Module: s = s + ")" return s -_warned = 0 - -def _try_registry(name): - # Emulate the Registered Module support on Windows. - try: - import _winreg - RegQueryValue = _winreg.QueryValue - HKLM = _winreg.HKEY_LOCAL_MACHINE - exception = _winreg.error - except ImportError: - try: - import win32api - RegQueryValue = win32api.RegQueryValue - HKLM = 0x80000002 # HKEY_LOCAL_MACHINE - exception = win32api.error - except ImportError: - global _warned - if not _warned: - _warned = 1 - print "Warning: Neither _winreg nor win32api is available - modules" - print "listed in the registry will not be found" - return None - try: - pathname = RegQueryValue(HKLM, \ - r"Software\Python\PythonCore\%s\Modules\%s" % (sys.winver, name)) - fp = open(pathname, "rb") - except exception: - return None - else: - # XXX - To do - remove the hard code of C_EXTENSION. - stuff = "", "rb", imp.C_EXTENSION - return fp, pathname, stuff - class ModuleFinder: def __init__(self, path=None, debug=0, excludes = [], replace_paths = []): @@ -389,11 +356,6 @@ class ModuleFinder: if name in sys.builtin_module_names: return (None, None, ("", "", imp.C_BUILTIN)) - if sys.platform=="win32": - result = _try_registry(name) - if result: - return result - path = self.path return imp.find_module(name, path) |