This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients gvanrossum, ncoghlan
Date 2007-11-30.20:39:11
SpamBayes Score 0.087046474
Marked as misclassified No
Message-id <1196455151.89.0.313857305752.issue1487@psf.upfronthosting.co.za>
In-reply-to
Content
I think the implementation is fine too (others will have to check it
more carefully) but I noticed that the promised functionality of -m
doesn't work yet: I created a file Lib/test/foo.py whose sole contents
was "from . import test_support". Then I tried to import this using
-m:

$ ./python.exe -m test.foo
Traceback (most recent call last):
 File "/Users/guido/p/Lib/runpy.py", line 104, in _run_module_as_main
   "__main__", fname, loader)
 File "/Users/guido/p/Lib/runpy.py", line 34, in _run_code
   exec code in run_globals
 File "/Users/guido/p/Lib/test/foo.py", line 1, in <module>
   from . import test_support
ValueError: Attempted relative import in non-package
$

What's missing here?
History
Date User Action Args
2007-11-30 20:39:12gvanrossumsetspambayes_score: 0.0870465 -> 0.087046474
recipients: + gvanrossum, ncoghlan
2007-11-30 20:39:11gvanrossumsetspambayes_score: 0.0870465 -> 0.0870465
messageid: <1196455151.89.0.313857305752.issue1487@psf.upfronthosting.co.za>
2007-11-30 20:39:11gvanrossumlinkissue1487 messages
2007-11-30 20:39:11gvanrossumcreate