diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-07-28 01:51:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-28 01:51:42 (GMT) |
commit | ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7 (patch) | |
tree | 158d1626a8fe583ee120147abbc649a4e7d21a0a /Lib/pdb.py | |
parent | 38ddc8beb38d9a685de296a58b0741850e4853e5 (diff) | |
download | cpython-ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7.zip cpython-ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7.tar.gz cpython-ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7.tar.bz2 |
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>
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 6 |
1 files changed, 5 insertions, 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): |