Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddy committed Feb 5, 2025
1 parent f1cb1e3 commit 2f46caf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Lib/test/test_traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -4501,8 +4501,8 @@ def __getattribute__(self, x):
print(x)
print(qq)

for name, instance in (("a", A()), ("b", B())):
with self.subTest(name=name):
for instance in (A(), B()):
with self.subTest(instance=instance):
actual = self.get_suggestion(instance, "pop")
self.assertIn("name 'qq' is not defined", actual)
self.assertEqual(actual.count("NameError"), 1)
Expand Down
2 changes: 1 addition & 1 deletion Lib/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@ def _compute_suggestion_error(exc_value, tb, wrong_name):
try:
if hasattr(self, wrong_name):
return f"self.{wrong_name}"
except Exception:
except NameError:
return None

try:
Expand Down

0 comments on commit 2f46caf

Please sign in to comment.