Skip to content

Commit

Permalink
Prevent start being later than stop for publicdb.download_data
Browse files Browse the repository at this point in the history
  • Loading branch information
153957 committed May 3, 2016
1 parent 0acc2b8 commit 605046d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sapphire/publicdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ def datetimerange(start, stop):
datetime.datetime(2010, 1, 5, 13, 0))
"""
if start.date() == stop.date():
if start > stop:
raise Exception('Start can not be after stop.')
elif start.date() == stop.date():
yield start, stop
return
else:
Expand Down

0 comments on commit 605046d

Please sign in to comment.