diff options
author | Paul Ganssle <paul@ganssle.io> | 2017-11-10 18:16:24 -0500 |
---|---|---|
committer | Paul Ganssle <paul@ganssle.io> | 2017-12-06 12:43:59 +0000 |
commit | 52e72944e0c49bb7e93094dfbf9a667bb621a866 (patch) | |
tree | d2baf8dbc26c7d5d9d0becf382242f6a79f8f41d /dateutil/parser | |
parent | 284c1a82e89da0fa56b2ff194965039f0599907a (diff) | |
download | dateutil-52e72944e0c49bb7e93094dfbf9a667bb621a866.tar.gz |
Add exception on too-short ISO times
Diffstat (limited to 'dateutil/parser')
-rw-r--r-- | dateutil/parser/isoparser.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/dateutil/parser/isoparser.py b/dateutil/parser/isoparser.py index d43c556..5fd63ed 100644 --- a/dateutil/parser/isoparser.py +++ b/dateutil/parser/isoparser.py @@ -342,6 +342,9 @@ class Isoparser(object): pos = 0 comp = -1 + if len(timestr) < 2: + raise ValueError('ISO time too short') + has_sep = len_str >= 3 and timestr[2:3] == cls._TIME_SEP while pos < len_str and comp < 5: |