diff --git a/smsbot/cli.py b/smsbot/cli.py index 76e0d3a..771d074 100644 --- a/smsbot/cli.py +++ b/smsbot/cli.py @@ -49,7 +49,11 @@ def main(): # Override with environment variables, named SMSBOT_
_ for key, value in os.environ.items(): if key.startswith(ENVIRONMENT_PREFIX): - section, option = key[7:].lower().split("_", 1) + try: + section, option = key[7:].lower().split("_", 1) + except ValueError: + logging.debug("Invalid environment variable format: %s", key) + continue logging.debug("Overriding config %s/%s = %s", section, option, value) if not config.has_section(section): config.add_section(section)