From 4f5da027b21a916e88b8670e0a63f1daf306d7a9 Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Fri, 8 Nov 2024 09:41:56 -0500 Subject: [PATCH] temporal: Fixed bare 'except' PEP8 error (#4670) --- .flake8 | 1 - .../temporal_topology_dataset_connector.py | 22 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.flake8 b/.flake8 index a44d0182e5f..45792c60cf7 100644 --- a/.flake8 +++ b/.flake8 @@ -74,7 +74,6 @@ per-file-ignores = python/grass/temporal/temporal_algebra.py: E722 python/grass/temporal/temporal_granularity.py: E722 python/grass/temporal/temporal_raster_base_algebra.py: E722 - python/grass/temporal/temporal_topology_dataset_connector.py: E722 # Current benchmarks/tests are changing sys.path before import. # Possibly, a different approach should be taken there anyway. python/grass/pygrass/tests/benchmark.py: E402, F821 diff --git a/python/grass/temporal/temporal_topology_dataset_connector.py b/python/grass/temporal/temporal_topology_dataset_connector.py index fddf478ad71..a296d9d4d78 100644 --- a/python/grass/temporal/temporal_topology_dataset_connector.py +++ b/python/grass/temporal/temporal_topology_dataset_connector.py @@ -160,47 +160,47 @@ def get_number_of_temporal_relations(self): relations = {} try: relations["equal"] = len(self._temporal_topology["EQUAL"]) - except: + except KeyError: relations["equal"] = 0 try: relations["follows"] = len(self._temporal_topology["FOLLOWS"]) - except: + except KeyError: relations["follows"] = 0 try: relations["precedes"] = len(self._temporal_topology["PRECEDES"]) - except: + except KeyError: relations["precedes"] = 0 try: relations["overlaps"] = len(self._temporal_topology["OVERLAPS"]) - except: + except KeyError: relations["overlaps"] = 0 try: relations["overlapped"] = len(self._temporal_topology["OVERLAPPED"]) - except: + except KeyError: relations["overlapped"] = 0 try: relations["during"] = len(self._temporal_topology["DURING"]) - except: + except KeyError: relations["during"] = 0 try: relations["contains"] = len(self._temporal_topology["CONTAINS"]) - except: + except KeyError: relations["contains"] = 0 try: relations["starts"] = len(self._temporal_topology["STARTS"]) - except: + except KeyError: relations["starts"] = 0 try: relations["started"] = len(self._temporal_topology["STARTED"]) - except: + except KeyError: relations["started"] = 0 try: relations["finishes"] = len(self._temporal_topology["FINISHES"]) - except: + except KeyError: relations["finishes"] = 0 try: relations["finished"] = len(self._temporal_topology["FINISHED"]) - except: + except KeyError: relations["finished"] = 0 return relations