From 8945ecdbbf37c8e0c280c915345c94139229a15c Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Fri, 10 Jan 2025 02:59:31 -0500 Subject: [PATCH 1/2] update --- .flake8 | 1 - python/grass/temporal/temporal_algebra.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.flake8 b/.flake8 index 9a8ded72afb..1076c8cf68f 100644 --- a/.flake8 +++ b/.flake8 @@ -45,7 +45,6 @@ per-file-ignores = python/grass/pygrass/vector/__init__.py: E402 python/grass/temporal/datetime_math.py: E722 python/grass/temporal/spatial_topology_dataset_connector.py: E722 - python/grass/temporal/temporal_algebra.py: E722 python/grass/temporal/temporal_granularity.py: E722 # Current benchmarks/tests are changing sys.path before import. # Possibly, a different approach should be taken there anyway. diff --git a/python/grass/temporal/temporal_algebra.py b/python/grass/temporal/temporal_algebra.py index 6c110205d3c..c0be497672f 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): self.msgr.fatal( "Error: the given expression does not contain a correct time " "difference object." From a6d9bb10c719c0416f836376de7a0726a0619c32 Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Tue, 14 Jan 2025 15:06:00 -0500 Subject: [PATCH 2/2] added error --- python/grass/temporal/temporal_algebra.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/grass/temporal/temporal_algebra.py b/python/grass/temporal/temporal_algebra.py index c0be497672f..9c33faa98f3 100644 --- a/python/grass/temporal/temporal_algebra.py +++ b/python/grass/temporal/temporal_algebra.py @@ -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 (IndexError, AttributeError): + except (IndexError, AttributeError, SyntaxError): self.msgr.fatal( "Error: the given expression does not contain a correct time " "difference object."