Brett Cannon added the comment:

When you execute a module on the command line, sys.path[0] is set to that 
containing directory (e.g. pkg/tests in your example; just have 
pkg/tests/ print out sys.path to see what I mean). ``import http`` 
is going to look on sys.path no matter what, and with ``pkg/tests`` being the 
first entry on sys.path, its going to find pkg/tests/ before it even has 
a chance to look in the directory containing the stdlib. A bare import only 
means "look on sys.path", not "magically only look in the stdlib".


Python tracker <>
Python-bugs-list mailing list

Reply via email to