use pickle protocol 2 for python2/3 compatibility

This commit is contained in:
Alan Hamlett 2015-08-22 19:55:46 -07:00
parent afc012ab63
commit 4e415fe4ab

View file

@ -52,7 +52,7 @@ class SessionCache(object):
conn, c = self.connect() conn, c = self.connect()
c.execute('DELETE FROM session') c.execute('DELETE FROM session')
values = { values = {
'value': pickle.dumps(session), 'value': pickle.dumps(session, protocol=2),
} }
c.execute('INSERT INTO session VALUES (:value)', values) c.execute('INSERT INTO session VALUES (:value)', values)
conn.commit() conn.commit()