[jhbuild/pre-3-cleanup] httpcache: use parsedate_tz(), mktime_tz() from the email package
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild/pre-3-cleanup] httpcache: use parsedate_tz(), mktime_tz() from the email package
- Date: Sat, 21 Sep 2019 21:59:57 +0000 (UTC)
commit 906a52600bcc73886fc31070e6b87ab6bfd6dd3c
Author: Christoph Reiter <reiter christoph gmail com>
Date: Sat Sep 21 22:52:15 2019 +0200
httpcache: use parsedate_tz(), mktime_tz() from the email package
This works with both Python 2 and 3
jhbuild/utils/httpcache.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/jhbuild/utils/httpcache.py b/jhbuild/utils/httpcache.py
index 5f92939d..0a0c818b 100644
--- a/jhbuild/utils/httpcache.py
+++ b/jhbuild/utils/httpcache.py
@@ -33,7 +33,7 @@ import sys
import urllib2
import urlparse
import time
-import rfc822
+from email.utils import parsedate_tz, mktime_tz
import StringIO
import gzip
@@ -52,9 +52,9 @@ def _format_isotime(tm):
return time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(tm))
def _parse_date(date):
- tm = rfc822.parsedate_tz(date)
+ tm = parsedate_tz(date)
if tm:
- return rfc822.mktime_tz(tm)
+ return mktime_tz(tm)
return 0
class CacheEntry:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]