Unverified Commit fd78fd53 authored by Sébastien Eustace's avatar Sébastien Eustace
Browse files

Fix error when config file is not present

parent c0fcaf71
Loading
Loading
Loading
Loading
+5 −0
Changes for poetry/config.py: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -3,12 +3,17 @@ from typing import Any

from .locations import CONFIG_DIR
from .utils.toml_file import TomlFile
from .utils.toml_file import TOMLFile


class Config:

    def __init__(self, file: TomlFile):
        self._file = file
        if not self._file.exists:
            self._raw_content = {}
            self._content = TOMLFile([])
        else:
            self._raw_content = file.read(raw=True)
            self._content = file.read()