Permalink
Browse files

be more tolerant with sympy.integrate errors

  • Loading branch information...
1 parent 8f5aa05 commit 8c60e42610845f4825b847bedbc77e60a3cace36 @poeschko poeschko committed Jan 31, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 mathics/builtin/calculus.py
@@ -421,6 +421,12 @@ def apply(self, f, xs, evaluation):
result = sympy.integrate(f_sympy, *vars)
except sympy.PolynomialError:
return
+ except ValueError:
+ # e.g. ValueError: can't raise polynomial to a negative power
+ return
+ except NotImplementedError:
+ # e.g. NotImplementedError: Result depends on the sign of -sign(_Mathics_User_j)*sign(_Mathics_User_w)
+ return
if prec is not None:
result = sympy.N(result)

0 comments on commit 8c60e42

Please sign in to comment.