[PATCH i-g-t v2 6/6] tools/intel-gfx-fw-info: do not use bare 'except'

Gustavo Sousa gustavo.sousa at intel.com
Wed Aug 21 17:19:48 UTC 2024


Quoting Lucas De Marchi (2024-08-20 20:29:28-03:00)
>From flake8:
>
>        tools/intel-gfx-fw-info:137:1: E722 do not use bare 'except'
>
>Now it passes clean with --ignore=E101,E501,W191 - those ignores are
>needed because they are triggering in the C string we use, CDEF, and
>flake8 can't bother enabling/disabling warnings per block.
>
>Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

Reviewed-by: Gustavo Sousa <gustavo.sousa at intel.com>

>---
> tools/intel-gfx-fw-info | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/tools/intel-gfx-fw-info b/tools/intel-gfx-fw-info
>index cbabda913..3c9b47809 100755
>--- a/tools/intel-gfx-fw-info
>+++ b/tools/intel-gfx-fw-info
>@@ -133,11 +133,11 @@ logging.basicConfig(format="%(levelname)s: %(message)s")
> 
> try:
>     from dissect import cstruct
>-except:
>+except ImportError as e:
>     logging.critical(
>         "Could not import dissect.cstruct module. See https://github.com/fox-it/dissect.cstruct for installation options"
>     )
>-    raise SystemExit(1)
>+    raise SystemExit(1) from e
> 
> 
> GSC_CPD_ENTRY_OFFSET_MASK = 0x1FFFFFF
>-- 
>2.43.0
>


More information about the igt-dev mailing list