platforms/target: only catch ModuleNotFoundError exceptions to improve error reporting (thanks mwelling)

This commit is contained in:
Florent Kermarrec 2019-11-16 09:40:30 +01:00
parent 2a0fbcadd2
commit 4231d59901
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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