From 4231d599012a46d9fe3198364376cac4418cbe76 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sat, 16 Nov 2019 09:40:30 +0100 Subject: [PATCH] platforms/target: only catch ModuleNotFoundError exceptions to improve error reporting (thanks mwelling) --- litex_boards/platforms.py | 2 +- litex_boards/targets.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/litex_boards/platforms.py b/litex_boards/platforms.py index ffa4b03..5400074 100644 --- a/litex_boards/platforms.py +++ b/litex_boards/platforms.py @@ -8,7 +8,7 @@ class Platforms: for support in ["official", "partner", "community"]: try: return importlib.import_module("litex_boards." + support + ".platforms." + name) - except: + except ModuleNotFoundError: pass raise ModuleNotFoundError diff --git a/litex_boards/targets.py b/litex_boards/targets.py index 8ae7041..293e35b 100644 --- a/litex_boards/targets.py +++ b/litex_boards/targets.py @@ -8,7 +8,7 @@ class Targets: for support in ["official", "partner", "community"]: try: return importlib.import_module("litex_boards." + support + ".targets." + name) - except: + except ModuleNotFoundError: pass raise ModuleNotFoundError