Commit 408fcb7f authored by Olivier Da Rocha's avatar Olivier Da Rocha Committed by ntome

[browser/exceptions] BrowserTooManyRequests: Raise a TypeError if the next_try is not a datetime

This will prevent from silently returning a bad datetime.
parent e91262be
......@@ -63,6 +63,9 @@ class BrowserTooManyRequests(BrowserUnavailable):
if next_try is None:
next_try = BrowserTooManyRequests.NEXT_24H
if not isinstance(next_try, datetime.datetime):
raise TypeError('next_try value should be a datetime.')
self.next_try = next_try
def __str__(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment