From afdf7c96aaead4ddc7e5ec7600dd2b00e31d4a71 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Mon, 2 Sep 2019 13:00:19 +0200 Subject: [PATCH] Clarified initialise config function Signed-off-by: Jim Martens --- src/twomartens/masterthesis/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/twomartens/masterthesis/config.py b/src/twomartens/masterthesis/config.py index 996cbeb..af8ea9f 100644 --- a/src/twomartens/masterthesis/config.py +++ b/src/twomartens/masterthesis/config.py @@ -137,7 +137,8 @@ def _initialise_config(config_file: str) -> None: try: with open(config_file, "r"): - pass + # if we reach this branch then the file exists and everything is fine + return except FileNotFoundError: with open(config_file, "w") as file: parser = configparser.ConfigParser()