From 966086a92e3ae58502469c808b9ab8d399bfd322 Mon Sep 17 00:00:00 2001 From: jross Date: Wed, 8 Jul 2026 15:29:30 -0600 Subject: [PATCH] Fix Python 2 except syntax breaking Python 3 parse Three `except A, B:` clauses were SyntaxErrors under Python 3, introduced by 545d3ab. They broke import/collection of core modules (backend/unifier.py wouldn't parse), failing CI and the whole backend test suite. Parenthesize each exception tuple. Co-Authored-By: Claude Opus 4.8 --- backend/persisters/ogc_features.py | 2 +- backend/unifier.py | 2 +- backend/well_correlation.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/persisters/ogc_features.py b/backend/persisters/ogc_features.py index 29cdda4..282cb27 100644 --- a/backend/persisters/ogc_features.py +++ b/backend/persisters/ogc_features.py @@ -136,7 +136,7 @@ def _num(value) -> Optional[float]: return None try: return float(value) - except TypeError, ValueError: + except (TypeError, ValueError): return None diff --git a/backend/unifier.py b/backend/unifier.py index 6b27ea7..2b2c1f6 100644 --- a/backend/unifier.py +++ b/backend/unifier.py @@ -148,7 +148,7 @@ def _site_wrapper(site_source, parameter_source, persister, config, raise_errors try: sites = site_source.read() - except USGSRateLimitError, PartialOrNoDataError: + except (USGSRateLimitError, PartialOrNoDataError): config.warn(incomplete_sites_record_msg) sites = [] diff --git a/backend/well_correlation.py b/backend/well_correlation.py index df5464f..0a6453c 100644 --- a/backend/well_correlation.py +++ b/backend/well_correlation.py @@ -112,7 +112,7 @@ def _num(value: Any) -> Optional[float]: return None try: return float(value) - except TypeError, ValueError: + except (TypeError, ValueError): return None