Skip to content

Commit

Permalink
Merge pull request #2 from gautamajay52/patch-2
Browse files Browse the repository at this point in the history
fix for 4(5) or 4(6(7)) and so on  in eval
  • Loading branch information
odysseusmax committed Jun 23, 2021
2 parents c44db36 + cb0ff6b commit 0c22823
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helpers/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def calcExpression(text):
return float(eval(text))
except (SyntaxError, ZeroDivisionError):
return ""
except TypeError:
return float(eval(text.replace('(', '*(')))
except Exception as e:
logger.error(e, exc_info=True)
return ""
Expand Down

0 comments on commit 0c22823

Please sign in to comment.