Updated email.Util (Python 2) references to email.utils (Python 3).

This commit is contained in:
Tim Graham 2017-10-13 15:36:09 -04:00
parent 4f27e475b3
commit f2868f9739
2 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ def rfc2822_date(date):
days = ('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun')
# Support datetime objects older than 1900
date = datetime_safe.new_datetime(date)
# We do this ourselves to be timezone aware, email.Utils is not tz aware.
# Timezone aware formatting. email.utils.formatdate() isn't tz aware.
dow = days[date.weekday()]
month = months[date.month - 1]
time_str = date.strftime('%s, %%d %s %%Y %%H:%%M:%%S ' % (dow, month))

View File

@ -145,7 +145,7 @@ def parse_http_date(date):
Return an integer expressed in seconds since the epoch, in UTC.
"""
# emails.Util.parsedate does the job for RFC1123 dates; unfortunately
# email.utils.parsedate() does the job for RFC1123 dates; unfortunately
# RFC7231 makes it mandatory to support RFC850 dates too. So we roll
# our own RFC-compliant parsing.
for regex in RFC1123_DATE, RFC850_DATE, ASCTIME_DATE: