mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
bpo-44461: Check early that a pdb target is valid for execution. (#27227)
* bpo-44461: Fix bug with pdb's handling of import error due to a package which does not have a __main__ module * 📜🤖 Added by blurb_it. * remove "else" Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> * If running as a module, first check that it can run as a module. Alternate fix for bpo-44461. Co-authored-by: Irit Katriel <iritkatriel@yahoo.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
parent
38ddc8beb3
commit
ee03bad25e
3 changed files with 20 additions and 1 deletions
|
|
@ -169,7 +169,11 @@ class ScriptTarget(str):
|
|||
|
||||
class ModuleTarget(str):
|
||||
def check(self):
|
||||
pass
|
||||
try:
|
||||
self._details
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
|
||||
@functools.cached_property
|
||||
def _details(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue