From: Fredrik Tolf Date: Thu, 3 Apr 2014 04:03:53 +0000 (+0200) Subject: Merge branch 'master' into python3 X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=commitdiff_plain;h=425ebacf6c53fa475ad0e8c7aea62d19617d4aea Merge branch 'master' into python3 Conflicts: wrw/session.py --- 425ebacf6c53fa475ad0e8c7aea62d19617d4aea diff --cc wrw/session.py index e7d8581,0c585a3..3185b0b --- a/wrw/session.py +++ b/wrw/session.py @@@ -1,5 -1,5 +1,5 @@@ --import threading, time, pickle, random, os -import cookie, env ++import threading, time, pickle, random, os, binascii +from . import cookie, env __all__ = ["db", "get"] @@@ -17,7 -8,7 +8,7 @@@ def gennonce(length) class session(object): def __init__(self, lock, expire=86400 * 7): - self.id = hexencode(gennonce(16)) - self.id = gennonce(16).encode("hex") ++ self.id = binascii.b2a_hex(gennonce(16)) self.dict = {} self.lock = lock self.ctime = self.atime = self.mtime = int(time.time())