Merge branch 'master' into python2
[wrw.git] / wrw / session.py
index 0c585a3..476113a 100644 (file)
@@ -1,5 +1,9 @@
 import threading, time, pickle, random, os
+<<<<<<< HEAD
 import cookie, env
+=======
+from . import cookie, env, proto
+>>>>>>> master
 
 __all__ = ["db", "get"]
 
@@ -8,7 +12,7 @@ def gennonce(length):
 
 class session(object):
     def __init__(self, lock, expire=86400 * 7):
-        self.id = gennonce(16).encode("hex")
+        self.id = proto.enhex(gennonce(16))
         self.dict = {}
         self.lock = lock
         self.ctime = self.atime = self.mtime = int(time.time())