Skip to content

Commit aa5168a

Browse files
committed
Fix, fix not run format tool when not install toml pkg
1 parent 38d4bbd commit aa5168a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

protobuf_to_pydantic/util.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ def format_content(content_str: str, pyproject_file_path: str = "") -> str:
137137
"The toml module is not installed and the configuration information cannot be obtained through"
138138
" pyproject.toml"
139139
)
140-
return content_str
141-
pyproject_content = get_pyproject_content(pyproject_file_path)
142-
if pyproject_content:
143-
pyproject_dict = toml.loads(pyproject_content)
140+
else:
141+
pyproject_content = get_pyproject_content(pyproject_file_path)
142+
if pyproject_content:
143+
pyproject_dict = toml.loads(pyproject_content)
144144
try:
145145
p2p_format_dict: dict = pyproject_dict["tool"]["protobuf-to-pydantic"]["format"]
146146
except KeyError:

0 commit comments

Comments
 (0)