From e0ef5a63f9b56ee97f89c9300f62992c69893a90 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 20 Jun 2019 14:47:36 -0400 Subject: [PATCH] test --- sopel_modules/SpiceBot/Read.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sopel_modules/SpiceBot/Read.py b/sopel_modules/SpiceBot/Read.py index 8305851..2cc3ff1 100644 --- a/sopel_modules/SpiceBot/Read.py +++ b/sopel_modules/SpiceBot/Read.py @@ -61,17 +61,17 @@ class BotRead(): # Read dictionary from file, if not, enable an empty dict filereadgood = True - inf = codecs.open(filepath, "r", encoding='utf-8') - infread = inf.read() try: + inf = codecs.open(filepath, "r", encoding='utf-8') + infread = inf.read() + # Close File + inf.close() dict_from_file = eval(infread) except Exception as e: filereadgood = False if logging: logs.log(log_from, "Error loading %s: %s (%s)" % (configtypename, e, filepath)) dict_from_file = dict() - # Close File - inf.close() # gather file stats slashsplit = str(filepath).split("/") @@ -112,17 +112,17 @@ class BotRead(): # Read dictionary from file, if not, enable an empty dict filereadgood = True - inf = codecs.open(jsonpath, "r", encoding='utf-8') - infread = inf.read() try: + inf = codecs.open(jsonpath, "r", encoding='utf-8') + infread = inf.read() dict_from_file = eval(infread) + # Close File + inf.close() except Exception as e: filereadgood = False if logging: logs.log("SpiceBot_Modules", "Error loading %s: %s (%s)" % ("Module Commands", e, jsonpath)) dict_from_file = dict() - # Close File - inf.close() # gather file stats slashsplit = str(filepath).split("/")