restrict use of os.environ in Configuration

Only use the OS environment, when the environ parameter is set
to None. Currently it would use the OS env on an empty dict.
This commit is contained in:
Sarah Hoffmann
2024-09-01 16:17:30 +02:00
parent 72be143cef
commit 882fb16881
4 changed files with 4 additions and 4 deletions

View File

@@ -61,7 +61,7 @@ class Configuration:
def __init__(self, project_dir: Optional[Union[Path, str]],
environ: Optional[Mapping[str, str]] = None) -> None:
self.environ = environ or os.environ
self.environ = os.environ if environ is None else environ
self.config_dir = paths.CONFIG_DIR
self._config = dotenv_values(str(self.config_dir / 'env.defaults'))
if project_dir is not None: