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
7187b10f
Commit
7187b10f
authored
Feb 20, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the python_path argument to safe_exec
parent
a04317b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
common/lib/capa/capa/capa_problem.py
+5
-3
No files found.
common/lib/capa/capa/capa_problem.py
View file @
7187b10f
...
...
@@ -17,7 +17,7 @@ from datetime import datetime
import
logging
import
math
import
numpy
import
os
import
os
,
os
.
path
import
re
import
struct
import
sys
...
...
@@ -452,7 +452,9 @@ class LoncapaProblem(object):
continue
# skip perl
# TODO: evaluate only python
python_path
.
extend
(
self
.
_extract_system_path
(
script
))
for
d
in
self
.
_extract_system_path
(
script
):
if
d
not
in
python_path
and
os
.
path
.
exists
(
d
):
python_path
.
append
(
d
)
XMLESC
=
{
"'"
:
"'"
,
"""
:
'"'
}
code
=
unescape
(
script
.
text
,
XMLESC
)
...
...
@@ -461,7 +463,7 @@ class LoncapaProblem(object):
if
all_code
:
try
:
locals_dict
=
{}
safe_exec
.
safe_exec
(
all_code
,
context
,
locals_dict
,
random_seed
=
self
.
seed
)
safe_exec
.
safe_exec
(
all_code
,
context
,
locals_dict
,
random_seed
=
self
.
seed
,
python_path
=
python_path
)
context
.
update
(
locals_dict
)
except
Exception
as
err
:
log
.
exception
(
"Error while execing script code: "
+
all_code
)
...
...
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