From 97f457b9dc426a1530639b2ce04b21c21f03eebe Mon Sep 17 00:00:00 2001 From: jakub-safetycli Date: Thu, 19 Dec 2024 15:58:29 -0800 Subject: [PATCH 1/2] Fix for NoneType is not iterable --- safety/scan/ecosystems/python/main.py | 3 ++- setup.cfg | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/safety/scan/ecosystems/python/main.py b/safety/scan/ecosystems/python/main.py index b72f840a..06415d3b 100644 --- a/safety/scan/ecosystems/python/main.py +++ b/safety/scan/ecosystems/python/main.py @@ -81,7 +81,8 @@ def ignore_vuln_if_needed( spec_ignored: bool = False - if vuln_id in ignore_vulns.keys() and str(specification.specifier) in ignore_vulns[vuln_id].specifications: + vuln = ignore_vulns.get(vuln_id) + if vuln is not None and vuln.specifications is not None and str(specification.specifier) in vuln.specifications: spec_ignored = True if (not spec_ignored) and \ diff --git a/setup.cfg b/setup.cfg index 9e5347f5..d9c7f156 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,7 @@ classifiers = [options] zip_safe = False include_package_data = True -packages = safety, safety.formatters,safety.formatters.schemas, safety.alerts, safety.auth, safety.scan, safety.scan.finder, safety.scan.ecosystems, safety.scan.ecosystems.python, safety.alerts.templates, safety.templates +packages = safety, safety.formatters,safety.formatters.schemas, safety.alerts, safety.auth, safety.scan, safety.scan.finder, safety.scan.ecosystems, safety.scan.ecosystems.python, safety.alerts.templates, safety.templates, safety.scan.fun_mode python_requires = >=3.7 package_dir = safety = safety From 433edbe6d41c0f70a63816ebab45fc84f8cb39a7 Mon Sep 17 00:00:00 2001 From: jakub-safetycli Date: Fri, 20 Dec 2024 08:53:50 -0800 Subject: [PATCH 2/2] Addressed review feedback --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d9c7f156..72c36621 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,7 +33,7 @@ classifiers = zip_safe = False include_package_data = True packages = safety, safety.formatters,safety.formatters.schemas, safety.alerts, safety.auth, safety.scan, safety.scan.finder, safety.scan.ecosystems, safety.scan.ecosystems.python, safety.alerts.templates, safety.templates, safety.scan.fun_mode -python_requires = >=3.7 +python_requires = >=3.8 package_dir = safety = safety install_requires =