File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ def split_len(seq, length):
357357
358358def to_time (_time ):
359359 if not _time .endswith (' GMT' ):
360- raise Exception ('Time does not end with GMT' )
360+ raise ValueError ('Time does not end with GMT' )
361361 _time = _time [:- 4 ]
362362 return mktime (str_to_time (_time , M2_TIME_FORMAT ))
363363
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def parse_duration(duration):
6868 else :
6969 sign = '+'
7070 if duration [index ] != "P" :
71- raise Exception ('Parse Duration is not valid.' )
71+ raise ValueError ('Parse Duration is not valid.' )
7272 index += 1
7373
7474 dic = dict ([(typ , 0 ) for (code , typ ) in D_FORMAT if typ ])
@@ -77,14 +77,14 @@ def parse_duration(duration):
7777 for code , typ in D_FORMAT :
7878 #print(duration[index:], code)
7979 if duration [index ] == '-' :
80- raise Exception ("Negation not allowed on individual items" )
80+ raise ValueError ("Negation not allowed on individual items" )
8181 if code == "T" :
8282 if duration [index ] == "T" :
8383 index += 1
8484 if index == len (duration ):
85- raise Exception ("Not allowed to end with 'T'" )
85+ raise ValueError ("Not allowed to end with 'T'" )
8686 else :
87- raise Exception ("Missing T" )
87+ raise ValueError ("Missing T" )
8888 elif duration [index ] == "T" :
8989 continue
9090 else :
You can’t perform that action at this time.
0 commit comments