summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 1b4ff54..9432111 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1694,6 +1694,14 @@ def main():
print('Error:', mainpyfile, 'does not exist')
sys.exit(1)
+ if run_as_module:
+ import runpy
+ try:
+ runpy._get_module_details(mainpyfile)
+ except Exception:
+ traceback.print_exc()
+ sys.exit(1)
+
sys.argv[:] = args # Hide "pdb.py" and pdb options from argument list
if not run_as_module: