mirror of
https://github.com/pocketpy/pocketpy
synced 2026-02-04 06:30:17 +00:00
Compare commits
3 Commits
eaa2e6d6f9
...
a2ea9d7b16
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2ea9d7b16 | ||
|
|
1c0daadb18 | ||
|
|
ef06103fa2 |
@ -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();
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user