• Kevin Modzelewski's avatar
    Support "asynchronous exceptions" · 3cb7d7b8
    Kevin Modzelewski authored
    A function at risk of "naive misuse", it is only accessible via the C API.
    
    This commit adds basic support for it using the same mechanism we use for
    signals.  We also have the GIL-check mechanism, but that would be a bit more
    work to get working right now due to the fact that our GIL-checks don't support
    throwing exceptions.  Doing the async-exc check during signal checking means
    that we will throw the async exc faster than CPython does.  It also means
    that there are some pathological cases where with a lot of threads and a lot
    of async excs we will probably have much worse performance.  But as long as they
    are rare I think this commit shouldn't add any steady-state performance costs.
    3cb7d7b8
ast_interpreter.cpp 75.7 KB