From: Thomas Petazzoni Date: Tue, 24 Mar 2020 13:54:35 +0000 (+0100) Subject: support/scripts/pkg-stats: fix flake8 E722 warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b5bc480a59a100e835b8d7739ce71c4f14d2dba;p=buildroot.git support/scripts/pkg-stats: fix flake8 E722 warning flake8 complains with: support/scripts/pkg-stats:339:13: E722 do not use bare 'except' Due to the construct: try: something except: print("some message") raise Which is in fact OK because the exception is re-raised. This issue is discussed at https://github.com/PyCQA/pycodestyle/issues/703, and the general agreement is that these "bare except" are OK, and should be ignored from flake8 using a noqa statement. Signed-off-by: Thomas Petazzoni --- diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index 4d8e932a9f..5adda6df08 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -336,7 +336,7 @@ class CVE: filename = CVE.download_nvd_year(nvd_dir, year) try: content = ijson.items(gzip.GzipFile(filename), 'CVE_Items.item') - except: + except: # noqa: E722 print("ERROR: cannot read %s. Please remove the file then rerun this script" % filename) raise for cve in content: