diff --git a/Lib/pdb.py b/Lib/pdb.py index 3db3e6a5be1a7b..28c56ed32c089c 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -327,8 +327,7 @@ def user_call(self, frame, argument_list): def user_line(self, frame): """This function is called when we stop or break at this line.""" if self._wait_for_mainpyfile: - if (self.mainpyfile != self.canonic(frame.f_code.co_filename) - or frame.f_lineno <= 0): + if (self.mainpyfile != self.canonic(frame.f_code.co_filename)): return self._wait_for_mainpyfile = False if self.bp_commands(frame): diff --git a/Misc/NEWS.d/next/Library/2023-07-06-08-28-12.gh-issue-100141.k3l_Z-.rst b/Misc/NEWS.d/next/Library/2023-07-06-08-28-12.gh-issue-100141.k3l_Z-.rst new file mode 100644 index 00000000000000..3582ba645a425d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-07-06-08-28-12.gh-issue-100141.k3l_Z-.rst @@ -0,0 +1 @@ +Fix Pdb infinite loop on empty code