Issue 1252550: modulefinder misses modules (original) (raw)

Failing top-level imports hide modules with the same name in packages.

The attached zipfile contains a script main.py and a simple contrived package demonstrating the problem.

If the zip-archive is unpacked to some directory, and modulefinder is run in this directory, it prints this:

c:\sf\test>py24 -m modulefinder main.py

Name File


m main main.py P a a_init.py P a.c a\c_init.py

Missing modules: ? spam imported from main, a

c:\sf\test>

With the attached patch, the output is like this:

c:\sf\test>py24 -m modulefinder main.py

Name File


m main main.py P a a_init.py P a.c a\c_init.py m a.c.spam a\c\spam.py m a.spam a\spam.py

Missing modules: ? spam imported from main

c:\sf\test>