From 4b9e9f99967da3ba27eebdb60ad3acaff609cdb0 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Fri, 5 Jul 2019 11:14:36 -0400 Subject: [PATCH] test --- sopel_modules/SpiceBot/Commands.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sopel_modules/SpiceBot/Commands.py b/sopel_modules/SpiceBot/Commands.py index fa96669..279d609 100644 --- a/sopel_modules/SpiceBot/Commands.py +++ b/sopel_modules/SpiceBot/Commands.py @@ -311,13 +311,25 @@ class BotCommands(): # Commands if str(detected_line).startswith("commands"): comtype = "module" - validcoms = eval(str(detected_line).split("commands")[-1]) + try: + validcoms = eval(str(detected_line).split("commands")[-1]) + except Exception as e: + validcoms = e + validcoms = [] elif str(detected_line).startswith("nickname_commands"): comtype = "nickname" - validcoms = eval(str(detected_line).split("nickname_commands")[-1]) + try: + validcoms = eval(str(detected_line).split("nickname_commands")[-1]) + except Exception as e: + validcoms = e + validcoms = [] elif str(detected_line).startswith("rule"): comtype = "rule" - validcoms = eval(str(detected_line).split("rule")[-1]) + try: + validcoms = eval(str(detected_line).split("rule")[-1]) + except Exception as e: + validcoms = e + validcoms = [] if isinstance(validcoms, tuple): validcoms = list(validcoms)