From d8713f0f4b1e64398da3150b83554ce7d540c321 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 8 Jun 2021 07:21:44 +0100 Subject: [PATCH] Too broad an exception is not a good idea --- .../interface_functions/router_provenance_gatherer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spinn_front_end_common/interface/interface_functions/router_provenance_gatherer.py b/spinn_front_end_common/interface/interface_functions/router_provenance_gatherer.py index 377a555dcc..51c9f2e85c 100644 --- a/spinn_front_end_common/interface/interface_functions/router_provenance_gatherer.py +++ b/spinn_front_end_common/interface/interface_functions/router_provenance_gatherer.py @@ -16,6 +16,7 @@ import logging from spinn_utilities.progress_bar import ProgressBar from spinn_utilities.log import FormatAdapter +from spinnman.exceptions import SpinnmanException from spinn_front_end_common.utilities.utility_objs import ProvenanceDataItem logger = FormatAdapter(logging.getLogger(__name__)) @@ -162,7 +163,7 @@ def _add_router_table_diagnostic( if not self._machine.get_chip_at(x, y).virtual: try: diagnostics = self._txrx.get_router_diagnostics(x, y) - except: # noqa: E722 + except SpinnmanException: logger.warning( "Could not read routing diagnostics from {}, {}", x, y, exc_info=True) @@ -184,7 +185,7 @@ def _add_unseen_router_chip_diagnostic( # pylint: disable=bare-except try: diagnostics = self._txrx.get_router_diagnostics(chip.x, chip.y) - except: # noqa: E722 + except SpinnmanException: # There could be issues with unused chips - don't worry! return if (diagnostics.n_dropped_multicast_packets or