[issue10129] Curious 'name not defined error' with 'python -m'

2010-10-16 Thread Georg Brandl
Georg Brandl added the comment: (This is not specific to running with -m, it occurs as well when you do "python a.py b.py".) The issue here is your call to exec() does not execute the code as its own module. It executes the code as part of the main() function in a.py, with (since you don't

[issue10129] Curious 'name not defined error' with 'python -m'

2010-10-16 Thread Andreas Kloeckner
New submission from Andreas Kloeckner : $ python3.1 -m a b.py results in Traceback (most recent call last): File "/usr/lib/python3.1/runpy.py", line 128, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python3.1/runpy.py", line 34, in _run_code exec(code,