Skip to content

Commit

Permalink
Merge pull request #1956 from posita/posita/fix-1955
Browse files Browse the repository at this point in the history
Fix Regression - Accommodates black.files.find_pyproject_toml returning None
  • Loading branch information
gopar committed Jan 13, 2022
2 parents 9e4382f + 5d3d329 commit edea332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elpy/blackutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def fix_code(code, directory):
pyproject_path = find_pyproject_toml((directory,))
else:
pyproject_path = os.path.join(directory, "pyproject.toml")
if toml is not None and os.path.exists(pyproject_path):
if toml and pyproject_path and os.path.exists(pyproject_path):
pyproject_config = toml.load(pyproject_path)
black_config = pyproject_config.get("tool", {}).get("black", {})
if "line-length" in black_config:
Expand Down

0 comments on commit edea332

Please sign in to comment.