mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
Two digit years are used/tested in py26 only
This commit is contained in:
+2
-2
@@ -264,10 +264,10 @@ class Client(object): # pylint: disable=too-many-instance-attributes
|
||||
when = parsedate_tz(retry_after)
|
||||
try:
|
||||
year = when[0] # raises TypeError if t is None
|
||||
# Handle two-digit years -- but any webserver that thinks
|
||||
# py26: Handle two-digit years -- but any server that thinks
|
||||
# "retry after 99" means "come back after 1999" is.. deprecated
|
||||
if year >= 0 and year < 100:
|
||||
when = [year + 2000] + list(when[1:])
|
||||
when = [year + 2000] + list(when[1:]) # pragma: no cover
|
||||
tzone = when[-1] if when[-1] else 0
|
||||
# raises ValueError/OverflowError
|
||||
return datetime.datetime(*when[:7]) - datetime.timedelta(tzone)
|
||||
|
||||
Reference in New Issue
Block a user