Compare commits

..

1 Commits

2 changed files with 3 additions and 5 deletions

View File

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

View File

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