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: Fix bare except clauses in datetime_math.py #4949

Merged
merged 2 commits into from
Jan 14, 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 @@ -42,7 +42,6 @@ per-file-ignores =
# TODO: Is this really needed?
python/grass/jupyter/__init__.py: E501
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
Expand Down
4 changes: 2 additions & 2 deletions python/grass/temporal/datetime_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from dateutil import parser

has_dateutil = True
except:
except (ImportError, ModuleNotFoundError):
has_dateutil = False


Expand Down Expand Up @@ -811,7 +811,7 @@ def check_datetime_string(time_string: str, use_dateutil: bool = True):

try:
return datetime.strptime(time_string, time_format)
except:
except (ValueError, TypeError):
return _("Unable to parse time string: %s") % time_string


Expand Down
Loading