Skip to content

Commit 78a74ec

Browse files
committed
catch invalid timeunit and throw error
1 parent b9a7f28 commit 78a74ec

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

datemath/helpers.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# !/usr/bin/python
2-
# coding=utf-8
3-
41
'''
52
A basic utility module for parsing math like strings relating to dates
63
@@ -205,7 +202,6 @@ def evaluate(expression, now, timeZone='UTC', roundDown=True):
205202
else:
206203
raise DateMathException('''Unable to determine a proper time qualifier. Do you have a proper numerical number followed by a valid time unit? i.e. '+1d', '-3d/d', etc.''')
207204
except Exception as e:
208-
'''Invalid numerical datematch'''
209205
raise DateMathException("Invalid datematch: What I got was - re.match: {0}, expression: {1}, error: {2}".format(expression[i+1:], expression, e))
210206

211207
if char == '+':

0 commit comments

Comments
 (0)