diff web/settings.py @ 586:87c20b8c5472 default master

port to python3
author Matt Johnston <matt@ucc.asn.au>
date Mon, 09 Sep 2019 22:24:10 +0800
parents 03e540c3ec24
children
line wrap: on
line diff
--- a/web/settings.py	Mon Sep 09 22:23:45 2019 +0800
+++ b/web/settings.py	Mon Sep 09 22:24:10 2019 +0800
@@ -1,6 +1,5 @@
-import gevent
+import gevent.event
 import fcntl
-import hashlib
 
 import binascii
 import os
@@ -38,7 +37,7 @@
         return '%s-%s' % (self.epoch, self.tag)
 
     def random(self):
-        return binascii.hexlify(os.urandom(self.RAND_SIZE))
+        return os.urandom(self.RAND_SIZE).hex()
 
     def update(self, contents, epoch = None):
         """ replaces settings contents and updates waiters if changed """