Don't fetch python libs if there's no python code

in the capa problem.
This commit is contained in:
Don Mitchell
2014-10-03 17:09:43 -04:00
parent c4dc7376ad
commit 0c795934c3

View File

@@ -646,14 +646,14 @@ class LoncapaProblem(object):
code = unescape(script.text, XMLESC)
all_code += code
# An asset named python_lib.zip can be imported by Python code.
extra_files = []
zip_lib = self.capa_system.get_python_lib_zip()
if zip_lib is not None:
extra_files.append(("python_lib.zip", zip_lib))
python_path.append("python_lib.zip")
if all_code:
# An asset named python_lib.zip can be imported by Python code.
zip_lib = self.capa_system.get_python_lib_zip()
if zip_lib is not None:
extra_files.append(("python_lib.zip", zip_lib))
python_path.append("python_lib.zip")
try:
safe_exec(
all_code,