Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python 3.5 changed `compile()` (which `eval_equation()` uses, far down the call stack) to raise `ValueError` in the case that used to raise a `TypeError`, so that block isn't necessary any more. See https://docs.python.org/3.8/library/functions.html#compile and #1386 (comment) Input that doesn't contain any dice expressions could still be processed and wind up at the wrong error handler; added an early-return for that. (An expression without dice rolls should be evaluated using `.calc`. And yes, I'm aware that this could be someone's spacebar heater. Tough!) The tests also now specifically cover an expression with no number of dice (to verify that the default of 1 die works), and cases where the input contains one or more valid dice expression(s) but has invalid syntax somewhere else in the string.
- Loading branch information