Skip to content

Commit

Permalink
Merge pull request #102 from evanpurkhiser/inline-bad-length
Browse files Browse the repository at this point in the history
Remove single-use bad_length
  • Loading branch information
kiorky authored Oct 30, 2024
2 parents 0dcc59c + d7510d8 commit 1af266b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/croniter/croniter.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,6 @@ class croniter(object):
130
)

bad_length = 'Exactly 5, 6 or 7 columns has to be specified for iterator ' \
'expression.'

def __init__(self, expr_format, start_time=None, ret_type=float,
day_or=True, max_years_between_matches=None, is_prev=False,
hash_id=None, implement_cron_bug=False, second_at_beginning=None,
Expand Down Expand Up @@ -831,7 +828,7 @@ def _expand(cls, expr_format, hash_id=None, second_at_beginning=False, from_time
expressions = efl.split()

if len(expressions) not in VALID_LEN_EXPRESSION:
raise CroniterBadCronError(cls.bad_length)
raise CroniterBadCronError("Exactly 5, 6 or 7 columns has to be specified for iterator expression.")

if len(expressions) > UNIX_CRON_LEN and second_at_beginning:
# move second to it's own(6th) field to process by same logical
Expand Down

0 comments on commit 1af266b

Please sign in to comment.