summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/saml2/sigver.py2
-rw-r--r--src/saml2/time_util.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/saml2/sigver.py b/src/saml2/sigver.py
index 3979d63a..3d744088 100644
--- a/src/saml2/sigver.py
+++ b/src/saml2/sigver.py
@@ -357,7 +357,7 @@ M2_TIME_FORMAT = '%b %d %H:%M:%S %Y'
def to_time(_time):
if not _time.endswith(' GMT'):
- raise Exception('Time does not end with GMT')
+ raise ValueError('Time does not end with GMT')
_time = _time[:-4]
return mktime(str_to_time(_time, M2_TIME_FORMAT))
diff --git a/src/saml2/time_util.py b/src/saml2/time_util.py
index b7f1f1cc..332d84bb 100644
--- a/src/saml2/time_util.py
+++ b/src/saml2/time_util.py
@@ -68,7 +68,7 @@ def parse_duration(duration):
else:
sign = '+'
if duration[index] != "P":
- raise Exception('Parse Duration is not valid.')
+ raise ValueError('Parse Duration is not valid.')
index += 1
dic = dict([(typ, 0) for (code, typ) in D_FORMAT if typ])
@@ -77,14 +77,14 @@ def parse_duration(duration):
for code, typ in D_FORMAT:
#print(duration[index:], code)
if duration[index] == '-':
- raise Exception("Negation not allowed on individual items")
+ raise ValueError("Negation not allowed on individual items")
if code == "T":
if duration[index] == "T":
index += 1
if index == len(duration):
- raise Exception("Not allowed to end with 'T'")
+ raise ValueError("Not allowed to end with 'T'")
else:
- raise Exception("Missing T")
+ raise ValueError("Missing T")
elif duration[index] == "T":
continue
else: