From 0840c7364a1fa7bc967a7f7fcb31d38677dc708f Mon Sep 17 00:00:00 2001 From: haosenwang1018 <167664334+haosenwang1018@users.noreply.github.com> Date: Thu, 26 Feb 2026 01:57:31 +0000 Subject: [PATCH] fix: replace 2 bare except clauses with except Exception --- testing/code/test_source.py | 2 +- testing/test_unittest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/code/test_source.py b/testing/code/test_source.py index 3512a86f9a8..879b8fd37d8 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -166,7 +166,7 @@ def test_getstatementrange_bug(self) -> None: x = ( y + z) - except: + except Exception: pass """ ) diff --git a/testing/test_unittest.py b/testing/test_unittest.py index 395c9fe647e..a580cb0b1de 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -372,7 +372,7 @@ def run(self, result): result.add{type}(self, excinfo._excinfo) except KeyboardInterrupt: raise - except: + except Exception: pytest.fail("add{type} should not raise") def test_hello(self): pass