Skip to content

Commit 714ab3e

Browse files
fix: use tomllib/tomli compat import for Python 3.10 (stdlib tomllib requires 3.11+)
1 parent 941d90d commit 714ab3e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/test_edge_cases.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
from io import StringIO
1010
from pathlib import Path
1111

12-
import tomllib
12+
try:
13+
import tomllib
14+
except ImportError:
15+
import tomli as tomllib # Python < 3.11 backport
1316
from rich.console import Console
1417

1518
from deploydiff.cli import _load_plan, _render_costs
@@ -161,4 +164,4 @@ def test_ruff_known_first_party(self):
161164
data = tomllib.load(f)
162165
isort_cfg = data.get("tool", {}).get("ruff", {}).get("lint", {}).get("isort", {})
163166
kfp = isort_cfg.get("known-first-party", [])
164-
assert kfp == ["deploydiff"], f"known-first-party should be ['deploydiff'], got {kfp}"
167+
assert kfp == ["deploydiff"], f"known-first-party should be ['deploydiff'], got {kfp}"

0 commit comments

Comments
 (0)