summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathieu Le Marec - Pasquet <kiorky@cryptelium.net>2016-11-01 09:58:09 +0100
committerGitHub <noreply@github.com>2016-11-01 09:58:09 +0100
commit2e466199990d42dd22f051c5e991bc61c0ccb2b9 (patch)
tree29b66166824d6d3bbb9f91d10d4799bbc5b9b8c2 /src
parente06b8c7ca32ee046eaa28124fca0fdd46c43b7b5 (diff)
parent4624807276a8f0b77ddee879112eb414d7e3fe42 (diff)
downloadcroniter-2e466199990d42dd22f051c5e991bc61c0ccb2b9.tar.gz
Merge pull request #63 from josegonzalez/issue-25
Raise ValueError on negative numbers
Diffstat (limited to 'src')
-rw-r--r--src/croniter/croniter.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/croniter/croniter.py b/src/croniter/croniter.py
index ee06fcb..086345c 100644
--- a/src/croniter/croniter.py
+++ b/src/croniter/croniter.py
@@ -110,6 +110,10 @@ class croniter(object):
# if j % int(step) == 0:
# e_list.append(j)
else:
+ if t.startswith('-'):
+ raise ValueError(
+ "[{0}] is not acceptable, negative numbers not allowed".format(
+ expr_format))
if not star_or_int_re.search(t):
t = self._alphaconv(i, t)