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 @@ def _runscript(self, filename): 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