[PATCH] D68104: [LNT] Python 3 support: adapt secret computation
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 10 03:19:33 PDT 2019
thopre updated this revision to Diff 224297.
thopre added a comment.
Fix mypy warning
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68104/new/
https://reviews.llvm.org/D68104
Files:
lnt/lnttool/create.py
Index: lnt/lnttool/create.py
===================================================================
--- lnt/lnttool/create.py
+++ lnt/lnttool/create.py
@@ -113,6 +113,7 @@
* INSTANCE_PATH should point to a directory that will keep
LNT configuration.
"""
+ from builtins import bytes
from .common import init_logger
import hashlib
import lnt.server.db.migrate
@@ -137,8 +138,12 @@
tmp_path = os.path.join(basepath, tmp_dir)
wsgi_path = os.path.join(basepath, wsgi)
schemas_path = os.path.join(basepath, "schemas")
- secret_key = (secret_key or
- hashlib.sha1(str(random.getrandbits(256))).hexdigest())
+ secret_key = (
+ secret_key or
+ hashlib.sha1(
+ bytes(str(random.getrandbits(256)), encoding="ascii")
+ ).hexdigest()
+ )
os.mkdir(instance_path)
os.mkdir(tmp_path)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68104.224297.patch
Type: text/x-patch
Size: 876 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191010/3111ce30/attachment.bin>
More information about the llvm-commits
mailing list