Skip to content

Commit 7fd3777

Browse files
committed
Use specific toml decode error
1 parent 6042330 commit 7fd3777

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/_pytest/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ def _is_setuptools_in_pyproject_toml(toml: Path) -> bool:
378378
build_system = parsed_toml.get("build-system", {}).get("requires")
379379
if "setuptools" in build_system:
380380
return True
381-
except Exception:
381+
except tomllib.TOMLDecodeError:
382+
# Not a valid Toml, so no setuptools.
382383
pass
383384

384385
return False

0 commit comments

Comments
 (0)