diff options
author | Raymond Hettinger <python@rcn.com> | 2012-04-29 21:57:05 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2012-04-29 21:57:05 (GMT) |
commit | a6df2ee7d084f830f100a5bd563005389d7d20c4 (patch) | |
tree | aa895645c077eef4653abac633cf5e35ec4f306d /Lib/imaplib.py | |
parent | 9f0ab9f5649b9b6ee54a023e83417f244b4665a0 (diff) | |
parent | 57404891a05fe1d5a70fc55ae84e75fe12fc7535 (diff) | |
download | cpython-a6df2ee7d084f830f100a5bd563005389d7d20c4.zip cpython-a6df2ee7d084f830f100a5bd563005389d7d20c4.tar.gz cpython-a6df2ee7d084f830f100a5bd563005389d7d20c4.tar.bz2 |
merge
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r-- | Lib/imaplib.py | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py index bda2ae9..681c7cf 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -22,7 +22,7 @@ Public functions: Internaldate2tuple __version__ = "2.58" -import binascii, errno, random, re, socket, subprocess, sys, time +import binascii, errno, random, re, socket, subprocess, sys, time, calendar try: import ssl @@ -1347,19 +1347,9 @@ def Internaldate2tuple(resp): zone = -zone tt = (year, mon, day, hour, min, sec, -1, -1, -1) + utc = calendar.timegm(tt) - zone - utc = time.mktime(tt) - - # Following is necessary because the time module has no 'mkgmtime'. - # 'mktime' assumes arg in local timezone, so adds timezone/altzone. - - lt = time.localtime(utc) - if time.daylight and lt[-1]: - zone = zone + time.altzone - else: - zone = zone + time.timezone - - return time.localtime(utc - zone) + return time.localtime(utc) |