From 53a3d2b2454ff9a612a376f58bb7c61733f82d12 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 13 Oct 2017 15:36:09 -0400 Subject: [PATCH] [2.0.x] Updated email.Util (Python 2) references to email.utils (Python 3). Backport of f2868f97399955650c47c948dc57c376bebb67b1 from master --- django/utils/feedgenerator.py | 2 +- django/utils/http.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py index 3b38eb5ed9..ec01d02697 100644 --- a/django/utils/feedgenerator.py +++ b/django/utils/feedgenerator.py @@ -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)) diff --git a/django/utils/http.py b/django/utils/http.py index aadd05ca43..5e900506ff 100644 --- a/django/utils/http.py +++ b/django/utils/http.py @@ -147,7 +147,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: