You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the foo/bar.py with import subdir and an empty foo/subdir/__init__.py, running python foo/bar.py exits with no exceptions printed and with an exit code of zero, however python -m vmprof foo/bar.py throws ImportError:
Traceback (most recent call last):
File "/opt/pypy/lib-python/2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/opt/pypy/lib-python/2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/mnt/home-extra/gsnedders/Documents/other-projects/csswg-testsuite-pypy-env/site-packages/vmprof/__main__.py", line 69, in <module>
main()
File "/mnt/home-extra/gsnedders/Documents/other-projects/csswg-testsuite-pypy-env/site-packages/vmprof/__main__.py", line 58, in main
runpy.run_path(args.program, run_name='__main__')
File "/opt/pypy/lib-python/2.7/runpy.py", line 240, in run_path
return _run_module_code(code, init_globals, run_name, path_name)
File "/opt/pypy/lib-python/2.7/runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File "/opt/pypy/lib-python/2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "foo/bar.py", line 1, in <module>
import subdir
ImportError: No module named subdir
This seems to be down to sys.path[0] differing between the two (sys.path[1:] is equal): without vmprof, it's the path to ./foo; with vmprof, it's '').
The text was updated successfully, but these errors were encountered:
gsnedders
added a commit
to gsnedders/vmprof-python
that referenced
this issue
Mar 29, 2016
Given the
foo/bar.py
withimport subdir
and an emptyfoo/subdir/__init__.py
, runningpython foo/bar.py
exits with no exceptions printed and with an exit code of zero, howeverpython -m vmprof foo/bar.py
throws ImportError:This seems to be down to
sys.path[0]
differing between the two (sys.path[1:]
is equal): without vmprof, it's the path to./foo
; with vmprof, it's '').The text was updated successfully, but these errors were encountered: