Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Fix infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
quwac committed Jan 9, 2022
1 parent 975aa53 commit c447005
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyproject-autoflake"
version = "0.2.0"
version = "0.3.0"
description = "pyproject-autoflake (pautoflake), a monkey patching wrapper to connect autoflake with pyproject.toml configuration."
authors = ["quwac <53551867+quwac@users.noreply.github.com>"]
readme = "README.md"
Expand Down
5 changes: 4 additions & 1 deletion pyproject_autoflake/pautoflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def _get_pyproject_toml_path(path_candidates: List[str]) -> str:
pyproject_toml_path = Path(dir_path, "pyproject.toml")
if pyproject_toml_path.exists() and pyproject_toml_path.is_file():
return str(pyproject_toml_path)
dir_path = dir_path.parent
next_dir_path = dir_path.parent
if next_dir_path == dir_path:
break
dir_path = next_dir_path

raise ValueError("pyproject.toml not found.")

Expand Down

0 comments on commit c447005

Please sign in to comment.