Skip to content

Commit

Permalink
Exception -> BaseException
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Nov 13, 2023
1 parent e4e968a commit e0c88f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7534,7 +7534,7 @@ class Foo(NamedTuple):
self.assertEqual(foo.attr.name, "attr")

def test_setname_raises_the_same_as_on_other_classes(self):
class CustomException(Exception): pass
class CustomException(BaseException): pass

class Annoying:
def __set_name__(self, owner, name):
Expand Down
2 changes: 1 addition & 1 deletion Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2734,7 +2734,7 @@ def __new__(cls, typename, bases, ns):
if hasattr(type(val), "__set_name__"):
try:
type(val).__set_name__(val, nm_tpl, key)
except Exception as e:
except BaseException as e:
e.add_note(
f"Error calling __set_name__ on {type(val).__name__!r} "
f"instance {key!r} in {typename!r}"
Expand Down

0 comments on commit e0c88f0

Please sign in to comment.