diff --git a/.flake8 b/.flake8 index 71cbdefe77b..20fa84370c1 100644 --- a/.flake8 +++ b/.flake8 @@ -43,7 +43,6 @@ per-file-ignores = python/grass/jupyter/__init__.py: E501 python/grass/pygrass/vector/__init__.py: E402 python/grass/temporal/spatial_topology_dataset_connector.py: E722 - python/grass/temporal/temporal_algebra.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: F821 diff --git a/python/grass/temporal/temporal_algebra.py b/python/grass/temporal/temporal_algebra.py index 6c110205d3c..9c33faa98f3 100644 --- a/python/grass/temporal/temporal_algebra.py +++ b/python/grass/temporal/temporal_algebra.py @@ -445,7 +445,7 @@ try: from ply import lex, yacc -except: +except ImportError: pass import copy @@ -2857,7 +2857,7 @@ def p_t_var_expr_td_hash(self, t) -> None: map_i.condition_value.append(boolname) else: map_i.condition_value = boolname - except: + except (IndexError, AttributeError, SyntaxError): self.msgr.fatal( "Error: the given expression does not contain a correct time " "difference object."