[pypy-issue] [issue945] import shadowing module from __init__.py as __main__ fails

Dirkjan Ochtman tracker at bugs.pypy.org
Tue Nov 29 20:42:55 CET 2011


New submission from Dirkjan Ochtman <dirkjan at ochtman.nl>:

I have a package x, like this:

x/__init__.py
x/symbol.py

For stupid reasons, I also use __init__.py as a script (i.e. run it with
__name__ == '__main__'). When I do so, and try to "import symbol", pypy gets me
the symbol module from the stdlib (which I didn't even know existed), whereas
cpython 2.7.2 gets me the symbol module from x.

----------
messages: 3510
nosy: djc, pypy-issue
priority: bug
status: unread
title: import shadowing module from __init__.py as __main__ fails

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue945>
________________________________________


More information about the pypy-issue mailing list