This is an automated email from the ASF dual-hosted git repository.
vatsrahul1001 pushed a commit to branch v3-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-2-test by this push:
new cac9cdb0b36 Registry: make tomllib fallback version-aware (#66666)
(#66918)
cac9cdb0b36 is described below
commit cac9cdb0b36b3028a5341d1bed753062caff7fa4
Author: Rahul Vats <[email protected]>
AuthorDate: Fri May 15 10:12:01 2026 +0530
Registry: make tomllib fallback version-aware (#66666) (#66918)
(cherry picked from commit 5b30aca938649d9c6b7f39325cddc1e320ec7f7d)
Co-authored-by: Shahar Epstein <[email protected]>
---
dev/registry/extract_metadata.py | 7 ++++---
dev/registry/extract_versions.py | 6 +++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dev/registry/extract_metadata.py b/dev/registry/extract_metadata.py
index 19b32dcbf18..0acabf69ece 100644
--- a/dev/registry/extract_metadata.py
+++ b/dev/registry/extract_metadata.py
@@ -36,16 +36,17 @@ import json
import re
import shutil
import subprocess
+import sys
import urllib.request
import zlib
from dataclasses import asdict, dataclass, field
from pathlib import Path
from typing import Any
-try:
+if sys.version_info >= (3, 11):
import tomllib # Python 3.11+ stdlib
-except ModuleNotFoundError: # pragma: no cover -- Python 3.10 fallback
- import tomli as tomllib # type: ignore[no-redef]
+else: # pragma: no cover -- Python 3.10 fallback
+ import tomli as tomllib
import yaml
from registry_contract_models import validate_providers_catalog
diff --git a/dev/registry/extract_versions.py b/dev/registry/extract_versions.py
index 2908b22b32e..cc5f094c79f 100644
--- a/dev/registry/extract_versions.py
+++ b/dev/registry/extract_versions.py
@@ -46,10 +46,10 @@ from datetime import datetime, timezone
from pathlib import Path
from typing import Any
-try:
+if sys.version_info >= (3, 11):
import tomllib # Python 3.11+ stdlib
-except ModuleNotFoundError: # pragma: no cover -- Python 3.10 fallback
- import tomli as tomllib # type: ignore[no-redef]
+else: # pragma: no cover -- Python 3.10 fallback
+ import tomli as tomllib
from registry_contract_models import validate_provider_version_metadata
try: