From b49199c7d19ec560a6f8b2ec3b478a6fae74bbc3 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 12 May 2019 09:41:36 -0500 Subject: [PATCH] makedirs, not mkdirs --- onionr/config.py | 14 +++++--------- onionr/onionr.py | 7 +++---- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/onionr/config.py b/onionr/config.py index 11319b85..67bd0bb3 100755 --- a/onionr/config.py +++ b/onionr/config.py @@ -96,15 +96,11 @@ def check(): Checks if the configuration file exists, creates it if not ''' - try: - if not os.path.exists(os.path.dirname(get_config_file())): - os.path.mkdirs(os.path.dirname(get_config_file())) - if not os.path.isfile(get_config_file()): - open(get_config_file(), 'a', encoding="utf8").close() - save() - except: - pass - #logger.debug('Failed to check configuration file.') + if not os.path.exists(os.path.dirname(get_config_file())): + os.path.makedirs(os.path.dirname(get_config_file())) + if not os.path.isfile(get_config_file()): + open(get_config_file(), 'a', encoding="utf8").close() + save() def save(): ''' diff --git a/onionr/onionr.py b/onionr/onionr.py index bc176c12..b8374905 100755 --- a/onionr/onionr.py +++ b/onionr/onionr.py @@ -77,10 +77,9 @@ class Onionr: logger.error('Tor is not installed') sys.exit(1) - # If data folder does not exist - if not data_exists: - if not os.path.exists(self.dataDir + 'blocks/'): - os.mkdir(self.dataDir + 'blocks/') + # If block data folder does not exist + if not os.path.exists(self.dataDir + 'blocks/'): + os.mkdir(self.dataDir + 'blocks/') # Copy default plugins into plugins folder if not os.path.exists(plugins.get_plugins_folder()):