Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temporal: Replace bare except with specific exceptions in temporal algebra parser #4933

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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
# 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
Expand Down
4 changes: 2 additions & 2 deletions python/grass/temporal/temporal_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@

try:
from ply import lex, yacc
except:
except ImportError:
pass

import copy
Expand Down Expand Up @@ -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."
Expand Down
Loading