Skip to content

Commit

Permalink
Evaluator: Limit; fix crash sukeesh#649
Browse files Browse the repository at this point in the history
  • Loading branch information
pnhofmann committed Feb 15, 2020
1 parent cac5437 commit 462a461
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion jarviscli/plugins/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ def try_limit(term, x, to, directory=''):
except NotImplementedError:
return "Sorry, cannot solve..."

if s == '':
jarvis.say("Usage: limit TERM")
return

s_split = s.split()
limit_to = []
term = ""
Expand All @@ -163,7 +167,12 @@ def try_limit(term, x, to, directory=''):

term = remove_equals(jarvis, term)
term = format_expression(term)
term = solve_y(term)

try:
term = solve_y(term)
except (sympy.SympifyError, TypeError):
jarvis.say('Error, not a valid term')
return

x = sympy.Symbol('x')

Expand Down

0 comments on commit 462a461

Please sign in to comment.