SCons tools and module name clashes

Paweł Tomulik <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.devel
Organization WUT
Message-ID <[email protected]>
Hi,

I've just faced a problem in one of my project, which I think may also
affect SCons + python3. To be short, I'd like to point to this code

https://bitbucket.org/scons/scons/src/38b0c56f96b6948dd07675d727e99728fb167238/src/engine/SCons/Tool/__init__.py?at=default&fileviewer=file-view-default#__init__.py-150

It attempts to load a tool module using importlib.import_module().
However, there is at least one name clash, namely the 'gettext' tool
which has same module name as THE 'gettext' module from Python library.

The problem is, that importlib.import_module() attempts to use cached
module (if it was previously imported) and particularly gettext is used
here:

https://bitbucket.org/scons/scons/src/38b0c56f96b6948dd07675d727e99728fb167238/src/engine/SCons/Script/SConsOptions.py?at=default&fileviewer=file-view-default#SConsOptions.py-34


So I guess, the

mod = importlib.import_module('gettext')

will always return the Python gettext module, not the SCons gettext
tool. Do you think, there is some solution/workaround to this problem?

Best Regards!
-- 
Pawel Tomulik
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.