[issue2751] Regression for executing packages

Benjamin Peterson report at bugs.python.org
Sun May 4 02:36:18 CEST 2008


New submission from Benjamin Peterson <musiccomposition at gmail.com>:

If I have a package like this:

pack/
    __init__.py

and __init__.py looks like this
if __name__ == "__main__":
    print "Spam"

python -m pack gives
one is a package and cannot be directly executed

This is regression from 2.5 where "Spam" would be printed.

----------
components: Interpreter Core
messages: 66184
nosy: benjamin.peterson
priority: critical
severity: normal
status: open
title: Regression for executing packages
type: behavior
versions: Python 2.6

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2751>
__________________________________


More information about the Python-bugs-list mailing list