Skip to content

Commit 6fc4edc

Browse files
committed
Fix Python 2.4 compatibility.
1 parent e62c0f4 commit 6fc4edc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

couchdb/http.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from httplib import BadStatusLine, HTTPConnection, HTTPSConnection
1818
import re
1919
import socket
20+
import time
2021
try:
2122
from cStringIO import StringIO
2223
except ImportError:
@@ -81,8 +82,8 @@ class RedirectLimit(Exception):
8182
CACHE_SIZE = 10, 75 # some random values to limit memory use
8283

8384
def cache_sort(i):
84-
return datetime.strptime(i[1][1]['Date'][5:-4], '%d %b %Y %H:%M:%S')
85-
85+
t = time.mktime(time.strptime(i[1][1]['Date'][5:-4], '%d %b %Y %H:%M:%S'))
86+
return datetime.fromtimestamp(t)
8687

8788
class ResponseBody(object):
8889

0 commit comments

Comments
 (0)