This commit is contained in:
killcerr 2026-02-02 21:40:22 +08:00
parent 1c0daadb18
commit 966a4444d8

View File

@ -203,18 +203,22 @@ assert a == [0, 1, 3, 4, 5]
try: try:
result = 10 / 0 result = 10 / 0
exit(1)
except (ZeroDivisionError, TypeError) as e: except (ZeroDivisionError, TypeError) as e:
assert type(e) == ZeroDivisionError if type(e) != ZeroDivisionError:
exit(1)
try: try:
try: try:
result = 10 / 0 result = 10 / 0
exit(1)
except (ZeroDivisionError, 1) as e: except (ZeroDivisionError, 1) as e:
assert False exit(1)
except (TypeError) as e: except (TypeError) as e:
assert False exit(1)
except Exception as e: except Exception as e:
assert type(e) == TypeError if type(e) != TypeError:
exit(1)
""" """
# finally, only # finally, only