Mailing List Archive

python/dist/src/Tools/freeze modulefinder.py,1.24,1.25
Update of /cvsroot/python/python/dist/src/Tools/freeze
In directory sc8-pr-cvs1:/tmp/cvs-serv28451

Modified Files:
modulefinder.py
Log Message:
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)


Index: modulefinder.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/freeze/modulefinder.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** modulefinder.py 25 Nov 2002 20:21:59 -0000 1.24
--- modulefinder.py 26 Nov 2002 08:05:09 -0000 1.25
***************
*** 60,96 ****
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:

--- 60,63 ----
***************
*** 390,398 ****
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)
--- 357,360 ----
Re: python/dist/src/Tools/freeze modulefinder.py,1.24,1.25 [ In reply to ]
> Log Message:
> 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)

Woo hoo! Hurray! <extatic noises>

--Guido van Rossum (home page: http://www.python.org/~guido/)