Compare commits

...

3 Commits

Author SHA1 Message Date
killcerr
a2ea9d7b16
Merge 1c0daadb18e09c6636184321b12749ec6600d189 into 2fa14c588463bf576bce766f6ae996e7e8e10271 2026-02-02 13:34:44 +00:00
killcerr
1c0daadb18 add test 2026-02-02 21:34:31 +08:00
killcerr
ef06103fa2 fix #440 2026-02-02 21:30:40 +08:00
2 changed files with 5 additions and 3 deletions

View File

@ -1167,10 +1167,10 @@ __NEXT_STEP:
has_invalid = true;
}
if(has_invalid) {
py_clearexc(NULL);
py_newnil(&self->unhandled_exc);
TypeError("catching classes that do not inherit from BaseException is not allowed");
c11_vector__pop(&frame->exc_stack);
goto __ERROR_RE_RAISE;
goto __ERROR;
} else {
py_newbool(TOP(), ok);
DISPATCH();

View File

@ -210,7 +210,9 @@ try:
try:
result = 10 / 0
except (ZeroDivisionError, 1) as e:
assert type(e) == ZeroDivisionError
assert False
except (TypeError) as e:
assert False
except Exception as e:
assert type(e) == TypeError