Skip to content

Commit 4d0cdbf

Browse files
Ruff: Preparation for TRY301 (#12738)
* Ruff: Preparation for TRY301 * update
1 parent a854911 commit 4d0cdbf

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

dojo/tools/blackduck_component_risk/importer.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,13 @@ def _process_zipfile(self, report: Path) -> (dict, dict, dict):
6262
elif "source" in file_name:
6363
with io.TextIOWrapper(zipf.open(full_file_name), encoding="utf-8") as f:
6464
source = self.__get_source(f)
65-
# Raise exception to error-out if the zip is missing either of
66-
# these files.
67-
if not (c_file and s_file):
68-
msg = "Zip file missing needed files!"
69-
raise Exception(msg)
70-
7165
except Exception:
7266
logger.exception("Could not process zip file")
67+
# Raise exception to error-out if the zip is missing either of
68+
# these files.
69+
if not (c_file and s_file):
70+
msg = "Zip file missing needed files!"
71+
raise Exception(msg)
7372

7473
return components, security_issues, source
7574

0 commit comments

Comments
 (0)