Skip to content

Commit 961bb42

Browse files
committed
Use specific toml decode error
1 parent 22e4e95 commit 961bb42

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
@@ -384,7 +384,8 @@ def _is_setuptools_in_pyproject_toml(toml: Path) -> bool:
384384
build_system = parsed_toml.get("build-system", {}).get("requires")
385385
if "setuptools" in build_system:
386386
return True
387-
except Exception:
387+
except tomllib.TOMLDecodeError:
388+
# Not a valid Toml, so no setuptools.
388389
pass
389390

390391
return False

0 commit comments

Comments
 (0)