Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try/except and try/finally in nopython mode #2097

Closed
seibert opened this issue Sep 3, 2016 · 5 comments
Closed

try/except and try/finally in nopython mode #2097

seibert opened this issue Sep 3, 2016 · 5 comments

Comments

@seibert
Copy link
Contributor

seibert commented Sep 3, 2016

No description provided.

@ehsantn
Copy link
Contributor

ehsantn commented Sep 1, 2017

Any updates on this?

@seibert
Copy link
Contributor Author

seibert commented Sep 1, 2017

None so far. You can raise an exception in nopython mode with static arguments and it will propagate out to the Python interpreter.

@seibert
Copy link
Contributor Author

seibert commented Nov 2, 2017

I don't think we'll see this by Numba 1.0.

@stuartarchibald
Copy link
Contributor

Basic support for try/except was implemented in #4902 for version 0.47.0

@esc
Copy link
Member

esc commented Sep 11, 2020

Not sure when it was added, but the construct appears to work on current master:

from numba import njit


@njit
def foo():
    try:
        x = 1
        raise Exception
    except Exception:
        pass
    finally:
        x += 1
    return x


print(foo())
 💣 zsh» python issue2097.py                                                                                                                                        :(
2

Hence I am closing this issue as the functionality requested has been implemented.

@esc esc closed this as completed Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants