diff options
| author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-06-22 00:57:39 (GMT) |
|---|---|---|
| committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-06-22 00:57:39 (GMT) |
| commit | e99d3a160ca622fff737a0f835f78e2c4705f9cc (patch) | |
| tree | 927a11ff40ff2fb04896a067613362a29eca5bdb /Lib/email/_parseaddr.py | |
| parent | 9bd4bf2a3d0426ee3830e89854ecf4bea03ac830 (diff) | |
| download | cpython-e99d3a160ca622fff737a0f835f78e2c4705f9cc.zip cpython-e99d3a160ca622fff737a0f835f78e2c4705f9cc.tar.gz cpython-e99d3a160ca622fff737a0f835f78e2c4705f9cc.tar.bz2 | |
Issue #14653: email.utils.mktime_tz() no longer relies on system
mktime() when timezone offest is supplied.
Diffstat (limited to 'Lib/email/_parseaddr.py')
| -rw-r--r-- | Lib/email/_parseaddr.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/email/_parseaddr.py b/Lib/email/_parseaddr.py index 3bd4ba4..690db2c 100644 --- a/Lib/email/_parseaddr.py +++ b/Lib/email/_parseaddr.py @@ -13,7 +13,7 @@ __all__ = [ 'quote', ] -import time +import time, calendar SPACE = ' ' EMPTYSTRING = '' @@ -150,13 +150,13 @@ def parsedate(data): def mktime_tz(data): - """Turn a 10-tuple as returned by parsedate_tz() into a UTC timestamp.""" + """Turn a 10-tuple as returned by parsedate_tz() into a POSIX timestamp.""" if data[9] is None: # No zone info, so localtime is better assumption than GMT return time.mktime(data[:8] + (-1,)) else: - t = time.mktime(data[:8] + (0,)) - return t - data[9] - time.timezone + t = calendar.timegm(data) + return t - data[9] def quote(str): |
