Skip to content

Commit f1305a3

Browse files
committed
Fix python3 fail comparing time struct to None
This is no longer a valid comparison in python3 as it is considered ambiguous. Specifically return True/False when None is encountered.
1 parent caa0eb8 commit f1305a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/saml2/time_util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,4 +313,8 @@ def later_than(after, before):
313313
elif isinstance(before, int):
314314
before = time.gmtime(before)
315315

316+
if before is None:
317+
return True
318+
if after is None:
319+
return False
316320
return after >= before

0 commit comments

Comments
 (0)