Clean up
This commit is contained in:
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
import codejail.safe_exec
|
import codejail.safe_exec
|
||||||
|
|
||||||
# This will set up the name "random" as a properly-seeded stand-in for the
|
# Establish the Python environment for Capa.
|
||||||
# random module. Also, capa assumes float-friendly division always.
|
# Capa assumes float-friendly division always.
|
||||||
|
# The name "random" is a properly-seeded stand-in for the random module.
|
||||||
CODE_PROLOG = """\
|
CODE_PROLOG = """\
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
|
||||||
import random as random_module
|
import random as random_module
|
||||||
random = random_module.Random(%r)
|
random = random_module.Random(%r)
|
||||||
random.Random = random_module.Random
|
random.Random = random_module.Random
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ def safe_exec(code, globals_dict, locals_dict, assumed_imports=None, files=None,
|
|||||||
jailed_code = "".join(the_code)
|
jailed_code = "".join(the_code)
|
||||||
|
|
||||||
# Turn this on to see what's being executed.
|
# Turn this on to see what's being executed.
|
||||||
if 1:
|
if 0:
|
||||||
print "--{:-<40}".format(" jailed ")
|
print "--{:-<40}".format(" jailed ")
|
||||||
print jailed_code
|
print jailed_code
|
||||||
print "--{:-<40}".format(" exec ")
|
print "--{:-<40}".format(" exec ")
|
||||||
|
|||||||
Reference in New Issue
Block a user