Skip to content

Commit

Permalink
Catch PyProjectException when pyproject.toml is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
estyxx authored and finswimmer committed Oct 11, 2020
1 parent 53cadad commit 2db820d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion poetry/console/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from cleo import argument
from cleo import option

from poetry.core.pyproject import PyProjectException
from poetry.core.toml.file import TOMLFile
from poetry.factory import Factory

Expand Down Expand Up @@ -80,7 +81,7 @@ def handle(self):
local_config_file = TOMLFile(self.poetry.file.parent / "poetry.toml")
if local_config_file.exists():
config.merge(local_config_file.read())
except RuntimeError:
except (RuntimeError, PyProjectException):
local_config_file = TOMLFile(Path.cwd() / "poetry.toml")

if self.option("local"):
Expand Down

0 comments on commit 2db820d

Please sign in to comment.