运行python时报错, TypeError: cannot concatenate 'str' and 'NoneType' objects,如何解决?

运行py文件时报错, TypeError: cannot concatenate 'str' and 'NoneType' objects

问题相关代码
```def load_env_variable(variable, default, variable_type=int):
    """
    Loading environmental variables
    :param variable: name of the variable
    :param default: default value if the environmental variable is not defined within .env
    :param variable_type: form that the variable should take
    :return:
    """
    if variable in os.environ:
        if variable_type is int:
            return int(os.environ[variable])
        elif variable_type is float:
            return float(os.environ[variable])
        elif variable_type is str:
            return str(os.environ[variable])
        elif variable_type is bool:
            return bool(int(os.environ[variable]))
    else:
        return default


SUBMISSION = load_env_variable("SUBMISSION", default=None, variable_type=str)
os.system('echo "run="' + SUBMISSION)

运行结果及报错内容
Traceback (most recent call last):
  File "./settings.py", line 31, in 
    os.system('echo "run="' + SUBMISSION)
TypeError: cannot concatenate 'str' and 'NoneType' objects

img

也有可能是没有获取到SUBMISSION变量,所以才会被识别为"NoneType" objects