I guess you can import it with "from sympy.core.sympify import
SympifyError".  We really should include all public exceptions in an
import *, though.

I made https://github.com/sympy/sympy/pull/1727 for this.  Any other
public exceptions that aren't being imported by default?

Aaron Meurer

On Tue, Jan 22, 2013 at 10:41 AM, Preston C <cowlina...@gmail.com> wrote:
> Hello,
>
> I'm trying to simply catch a SympifyError, and I cannot seem to get it
> working.  What am I doing wrong?
>
> import sympy
> from sympy import *
> from sympy import core
> from sympy.core import sympify
> from sympy.interactive import *
> ...
> try:
>     sympyEvaluationFloat = sympy.N(expression)
> except (ZeroDivisionError, SympifyError):
>     print("cannot evaluate expression: " + expression)
>     return
>
> I get the error "global name 'SympifyError' is not defined".
> I've also tried sympy.SympifyError, and I get the error "'module' object has
> no attribute 'SympifyError'".
> I've also tried sympy.core.sympify.SympifyError, and I get the error
> "'module' object has no attribute 'sympify'".
>
> The documentation seems to be completely void of information on this
> subject.
> Please help!
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sympy/-/GPF_tDOKkagJ.
> To post to this group, send email to sympy@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to