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

Using evaluate context manager inside try clause messes things up #13303

Open
Wrzlprmft opened this issue Sep 12, 2017 · 2 comments
Open

Using evaluate context manager inside try clause messes things up #13303

Wrzlprmft opened this issue Sep 12, 2017 · 2 comments

Comments

@Wrzlprmft
Copy link

Wrzlprmft commented Sep 12, 2017

I proceed straight to the minimal example:

from sympy import sympify, evaluate
from sympy.abc import x,y

try:
    with evaluate(False):
        sympify(")")
except:
    pass

(x+y).simplify()

This causes some obscure error in the last line that is gone when the try–except statement is removed. The error is also gone if evaluate is moved out of the try clause. While this should arguably done anyway in most cases, the error indicates that something more is going wrong.

@Eight1911
Copy link
Contributor

Just out of curiosity, how did you manage to find this bug? I'm really impressed.

@Wrzlprmft
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants