Module name does not match file name

Chris Angelico rosuav at gmail.com
Mon Jul 7 05:03:33 EDT 2014


On Mon, Jul 7, 2014 at 6:57 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> which suggests that the pgmodule.so file creates a module called "pg".
> What I don't understand is how "import pg" gets turned into "run
> pgmodule.so"?

What happens if you *don't* import pg? Is there a sys.modules["pg"]
already? If so, I'd go looking at what gets imported on startup - in
fact, either way, "python -v" output might be of value here.

ChrisA



More information about the Python-list mailing list