Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a40aed58
Commit
a40aed58
authored
Feb 20, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up
parent
4fb73248
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
common/lib/capa/capa/safe_exec.py
+4
-2
common/lib/codejail/codejail/safe_exec.py
+1
-1
No files found.
common/lib/capa/capa/safe_exec.py
View file @
a40aed58
...
...
@@ -2,10 +2,12 @@
import
codejail.safe_exec
# This will set up the name "random" as a properly-seeded stand-in for the
# random module. Also, capa assumes float-friendly division always.
# Establish the Python environment for Capa.
# Capa assumes float-friendly division always.
# The name "random" is a properly-seeded stand-in for the random module.
CODE_PROLOG
=
"""
\
from __future__ import division
import random as random_module
random = random_module.Random(
%
r)
random.Random = random_module.Random
...
...
common/lib/codejail/codejail/safe_exec.py
View file @
a40aed58
...
...
@@ -73,7 +73,7 @@ def safe_exec(code, globals_dict, locals_dict, assumed_imports=None, files=None,
jailed_code
=
""
.
join
(
the_code
)
# Turn this on to see what's being executed.
if
1
:
if
0
:
print
"--{:-<40}"
.
format
(
" jailed "
)
print
jailed_code
print
"--{:-<40}"
.
format
(
" exec "
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment