mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 13:59:02 -04:00
Two digit years are used/tested in py26 only
This commit is contained in:
parent
c3ddb47cfa
commit
6fd3dba737
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue