From d330cb6035910249d658d40c6cd827c165fa064d Mon Sep 17 00:00:00 2001 From: Shantanu Jain Date: Sun, 17 Nov 2024 21:52:35 -0800 Subject: [PATCH 1/3] gh-126944: Better error for missing arg in pdb --- Lib/pdb.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/pdb.py b/Lib/pdb.py index b7f6fd4323407e..396d87735c3a5f 100644 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -1774,6 +1774,9 @@ def _getval(self, arg): try: return eval(arg, self.curframe.f_globals, self.curframe.f_locals) except: + if not arg: + self.error("Missing arg!") + raise self._error_exc() raise From fc8f0e7ef1afacc5c9c1a9c1d3348da6039a743d Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 05:53:58 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2024-11-18-05-53-52.gh-issue-126944.WQv56W.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2024-11-18-05-53-52.gh-issue-126944.WQv56W.rst diff --git a/Misc/NEWS.d/next/Library/2024-11-18-05-53-52.gh-issue-126944.WQv56W.rst b/Misc/NEWS.d/next/Library/2024-11-18-05-53-52.gh-issue-126944.WQv56W.rst new file mode 100644 index 00000000000000..55898098081d54 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-11-18-05-53-52.gh-issue-126944.WQv56W.rst @@ -0,0 +1 @@ +Better error for missing arguments in :mod:`pdb` commands. From 6d43e745177ccd851b02abb70b821f0438379606 Mon Sep 17 00:00:00 2001 From: Shantanu Jain Date: Sun, 17 Nov 2024 21:54:40 -0800 Subject: [PATCH 3/3] longer text --- Lib/pdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/pdb.py b/Lib/pdb.py index 396d87735c3a5f..702058ab5d777a 100644 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -1775,7 +1775,7 @@ def _getval(self, arg): return eval(arg, self.curframe.f_globals, self.curframe.f_locals) except: if not arg: - self.error("Missing arg!") + self.error("Missing argument to command!") raise self._error_exc() raise