Compare commits

..

1 Commits

2 changed files with 3 additions and 5 deletions

View File

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

View File

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