Eric V. Smith <e...@trueblade.com> added the comment:

You should just be using "import index". By using "import index.py", you're 
telling the interpreter to first import index, execute the code in it, then 
look for a sub-module named "py" (full name: index.py). Since no such 
sub-module exists, and index is not a package, you get the exception you're 
seeing.

It's like "import os.path": first import "os", then look for "path" inside of 
that.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41042>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to