Skip to content
Snippets Groups Projects
Commit b5dc95a3 authored by Ayub khan's avatar Ayub khan
Browse files

BOM-609

python3 compatibility
parent 2de3667c
No related branches found
Tags release-2021-06-15-13.28
No related merge requests found
......@@ -117,7 +117,7 @@ def safe_exec(
if cache:
safe_globals = json_safe(globals_dict)
md5er = hashlib.md5()
md5er.update(six.b(repr(code)))
md5er.update(repr(code).encode('utf-8'))
update_hash(md5er, safe_globals)
key = "safe_exec.%r.%s" % (random_seed, md5er.hexdigest())
cached = cache.get(key)
......@@ -146,6 +146,8 @@ def safe_exec(
python_path=python_path, extra_files=extra_files, slug=slug,
)
except SafeExecException as e:
# Saving SafeExecException e in exception to be used later.
exception = e
emsg = text_type(e)
else:
emsg = None
......@@ -158,4 +160,4 @@ def safe_exec(
# If an exception happened, raise it now.
if emsg:
raise e
raise exception
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment