New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pdb breaks programs which import from __main__ #42482
Comments
The following example illustrates the problem: bagira:~/python/dist/src/Lib> cat tt/xx bagira:~/python/dist/src/Lib> cat tt/yy.py this works by itself: bagira:~/python/dist/src/Lib> ../python tt/xx But breaks under pdb bagira:~/python/dist/src/Lib> ../python -m pdb tt/xx
> /home/ilya/python/dist/src/Lib/tt/xx(1)?()
-> hello=None
(Pdb) c
Traceback (most recent call last):
File "/home/ilya/python/dist/src/Lib/pdb.py", line
1057, in main
pdb._runscript(mainpyfile)
File "/home/ilya/python/dist/src/Lib/pdb.py", line
982, in _runscript
self.run(statement, globals=globals_, locals=locals_)
File "/home/ilya/python/dist/src/Lib/bdb.py", line
367, in run
exec cmd in globals, locals
File "<string>", line 1, in ?
File "tt/xx", line 2, in ?
import yy
File "/home/ilya/python/dist/src/Lib/tt/yy.py", line
1, in ?
from __main__ import hello
ImportError: cannot import name hello
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /home/ilya/python/dist/src/Lib/tt/yy.py(1)?()
-> from __main__ import hello |
Logged In: YES I have submitted a patch bpo-1429539 for this |
Fixed with said patch. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: