This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Modulefinder doesn't handle PyXML
Type: Stage:
Components: Demos and Tools Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: theller Nosy List: loewis, theller
Priority: normal Keywords: patch

Created on 2002-11-13 16:16 by theller, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
modulefinder.py.diff theller, 2002-11-13 16:16 Patch for modulefinder
Messages (5)
msg41635 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2002-11-13 16:16
The attached patch adds a mechanism to handle cases 
like PyXML, where a module injects itself into 
sys.modules under a different name. With a special 
version of py2exe I was able to freeze some of the 
PyXML test scripts, although I didn't succeed with 
freeze - the extension modules did not load.
msg41636 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-11-13 23:44
Logged In: YES 
user_id=21627

How is this supposed to be used? Do you add to
replaceModuleMap only if the replacement module is present?
msg41637 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2002-11-14 08:50
Logged In: YES 
user_id=11105

I call
  ReplaceModule("_xmlplus", "xml")
and then run ModuleFinder on my script.

Only when the module named "_xmlplus" is loaded by 
load_package, the replaceModule hook is triggered. With the 
above call, it is then inserted into ModuleFinder's modules 
instance var under the name "xml", and not "_xmlplus". This 
mirrors what is done by _xmlplus/__init__.py file.

Now that I think over it, probably ReplaceModule should be 
renamed to ReplacePackage ...
msg41638 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-11-14 13:47
Logged In: YES 
user_id=21627

The patch is fine (with the renaming), please apply it.
msg41639 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2003-02-05 17:24
Logged In: YES 
user_id=11105

Has been checked in for quite some time.
History
Date User Action Args
2022-04-10 16:05:53adminsetgithub: 37466
2002-11-13 16:16:36thellercreate