[issue32691] "pdb -m <module>" sets __main__.__package__ incorrectly

Nick Coghlan report at bugs.python.org
Thu Feb 1 10:25:20 EST 2018


Nick Coghlan <ncoghlan at gmail.com> added the comment:

I forget we had mod_spec.parent available to us these days, so yes, we should use that rather than recalculating the parent with str.rpartition.

As Mario noted, we only want to change the behaviour when the executed module is a plain module or submodule, rather than being a package in its own right with a pkg.__main__ submodule (since the current behaviour is correct in the latter case).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32691>
_______________________________________


More information about the Python-bugs-list mailing list