HELP: Cannot use freeze.py on program importing 4Suite

Andrew Dalke dalke at acm.org
Tue Nov 14 02:14:35 EST 2000


Ben Chang wrote in message ...
>No, this won't work. Because, the 4Suite has its own loader
>"_4dom_fileImport",
>which looks for the module in the file system, loads it, and assigns it to
a
>local variable
>
>   Element = implementation._4dom_fileImport('Element').Element

Okay, so that didn't work.  As another workaround you can force
changes to sys.modules to make it look like a module was imported.

>>> import string, sys
>>> sys.modules["math"] = string
>>> import math
>>> math.find("ABCD", "C")
2

Or you can explicitly replace _4dom_fileImport with your own function
which knows how to get the right module.

You'll have to get a real answer from someone more knowledgeable
about the 4Suite code.  Sorry.

                    Andrew
                    dalke at acm.org






More information about the Python-list mailing list