Skip to content

Commit

Permalink
[calc] Account for smartasses dividing by zero
Browse files Browse the repository at this point in the history
Also remove a debugging line I accidentally left in.
  • Loading branch information
embolalia committed Nov 9, 2013
1 parent 0c9f54e commit 88eb2a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ def c(bot, trigger):
return bot.reply("Nothing to calculate.")
try:
result = eval_equation(trigger.group(2))
except Exception as e:
raise e
except ZeroDivisionError:
result = "Division by zero is not supported in this universe."
except Exception:
result = ("Sorry, I can't calculate that with this command. "
"I might have another one that can. "
"Use .commands for a list.")
Expand Down

0 comments on commit 88eb2a7

Please sign in to comment.