Irit Katriel <iritkatr...@gmail.com> added the comment:

The difference between Jason's two test cases is which stage of 
Pdb._runmodule() fails. 

In the case of `python -m pdb -m importlib` 
runpy._get_module_details(module_name) raises an exception because importlib is 
a package and it looks for its __main__, so self.run(code) is never called.

In the case of `python -m pdb -m foo` with foo that raises an exception,  foo 
is not a package so the __main__ check doesn't happen. The exception comes from 
within the self.run(code) call (when the module is executed). self.run() calls 
self.reset() before executing the code, and reset() calls Bdb.reset() which 
initializes self.botframe (to None).

----------
nosy: +iritkatriel

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44461>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to