X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=blobdiff_plain;f=wrw%2Fsession.py;h=814182759d584e30e5aff52df6c7781815e74458;hp=f9b4a3f446b9f7fd704834672b8b465f69f1c44a;hb=c4b97e160d6f6a3e4ac6a940c1bda0c6759ca4e8;hpb=ab4f58a02fb66610c4bda3d4763f455e764c51be diff --git a/wrw/session.py b/wrw/session.py index f9b4a3f..8141827 100644 --- a/wrw/session.py +++ b/wrw/session.py @@ -1,5 +1,5 @@ -import threading, time, pickle, random, os, binascii -from . import cookie, env +import threading, time, pickle, random, os +from . import cookie, env, proto __all__ = ["db", "get"] @@ -8,7 +8,7 @@ def gennonce(length): class session(object): def __init__(self, lock, expire=86400 * 7): - self.id = binascii.b2a_hex(gennonce(16)).decode("us-ascii") + self.id = proto.enhex(gennonce(16)) self.dict = {} self.lock = lock self.ctime = self.atime = self.mtime = int(time.time())