Skip to content

Commit

Permalink
Simplify parse expression code
Browse files Browse the repository at this point in the history
# Remove redundant inner variable!
  • Loading branch information
jsharkey13 committed Feb 20, 2018
1 parent 7cd4f5a commit bbc3aab
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions checker/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ def parse_expression(expression_str, local_dict=None):
actual functions they will call when evaluated.
"""
try:
parsed_expr = parsing.parse_expr(expression_str, local_dict=local_dict)
return parsed_expr
return parsing.parse_expr(expression_str, local_dict=local_dict)
except (sympy.parsing.sympy_tokenize.TokenError, SyntaxError, TypeError, AttributeError, NumericRangeException) as e:
print "Incorrectly formatted expression."
print ("ERROR: %s - %s" % (type(e).__name__, e.message)).strip(":- ")
Expand Down

0 comments on commit bbc3aab

Please sign in to comment.