From 0c795934c31c1d4e99cea949c0e30acd39e32264 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Fri, 3 Oct 2014 17:09:43 -0400 Subject: [PATCH] Don't fetch python libs if there's no python code in the capa problem. --- common/lib/capa/capa/capa_problem.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/lib/capa/capa/capa_problem.py b/common/lib/capa/capa/capa_problem.py index f3eb115ad6..a854e1109f 100644 --- a/common/lib/capa/capa/capa_problem.py +++ b/common/lib/capa/capa/capa_problem.py @@ -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,