Skip to content

Commit 4a2b093

Browse files
authored
Ensure execute the python execute phase works correctly. (#1153)
Signed-off-by: Caleb Brown <calebbrown@google.com>
1 parent 1539868 commit 4a2b093

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

sandboxes/dynamicanalysis/analyze-python.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,13 @@ def import_module(import_path):
103103
def execute_package(package):
104104
"""Execute phase for analyzing the package."""
105105
for p in module_paths_to_import(package):
106-
# if we're here, importing should have already worked during import phase
107-
module = importlib.import_module(p)
108-
execute_module(module)
106+
try:
107+
module = importlib.import_module(p)
108+
except BaseException:
109+
# We reach here when import fails. So skip this package.
110+
continue
111+
else:
112+
execute_module(module)
109113

110114

111115
def execute_module(module):

0 commit comments

Comments
 (0)