diff --git a/Lib/pdb.py b/Lib/pdb.py index 23bc6dfa16b..d379d1a9abd 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -1211,7 +1211,7 @@ see no sign that the breakpoint was reached. self.mainpyfile = self.canonic(filename) self._user_requested_quit = 0 with open(filename) as fp: - statement = fp.read() + statement = "exec(%r)" % (fp.read(),) self.run(statement) # Simplified interface diff --git a/Misc/NEWS b/Misc/NEWS index b37f18e26f6..e650b33b800 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -34,6 +34,9 @@ C-API Library ------- +- Issue #6323: The pdb debugger did not exit when running a script with a + syntax error. + - Issue #6369: Fix an RLE decompression bug in the binhex module. - Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.