Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
27aa7e4a
Unverified
Commit
27aa7e4a
authored
5 years ago
by
Ayub
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #21806 from edx/BOM-609
BOM-609
parents
f4ca2035
b5dc95a3
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/capa/capa/safe_exec/safe_exec.py
+4
-2
4 additions, 2 deletions
common/lib/capa/capa/safe_exec/safe_exec.py
with
4 additions
and
2 deletions
common/lib/capa/capa/safe_exec/safe_exec.py
+
4
−
2
View file @
27aa7e4a
...
...
@@ -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
e
xception
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment