From 3a8b7846ab512cc8c48538a73f4e4753b0a7acdb Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 28 Oct 2019 13:33:08 +0100 Subject: [PATCH] Fix creating config file on Windows --- nw/config.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nw/config.py b/nw/config.py index 6baf30a2..b5787771 100644 --- a/nw/config.py +++ b/nw/config.py @@ -15,7 +15,7 @@ import configparser import sys import nw -from os import path, mkdir, getcwd +from os import path, mkdir, makedirs, getcwd from appdirs import user_config_dir from datetime import datetime @@ -166,9 +166,12 @@ class Config: # If config folder does not exist, make it. # This assumes that the os config folder itself exists. - # TODO: This does not work on Windows - if not path.isdir(self.confPath): - mkdir(self.confPath) + if self.osWindows: + if not path.isdir(self.confPath): + makedirs(self.confPath) + else: + if not path.isdir(self.confPath): + mkdir(self.confPath) # Check if config file exists if path.isfile(path.join(self.confPath,self.confFile)):