Add check for invalid kwargs
This commit is contained in:
@@ -104,7 +104,11 @@ def update_env_variables():
|
||||
custom_regroup = os.getenv('CUSTOM_REGROUP', 'cm_sl=84_sl=42++++++1')
|
||||
detect_language_length = os.getenv('DETECT_LANGUAGE_LENGTH', 30)
|
||||
skipifexternalsub = convert_to_bool(os.getenv('SKIPIFEXTERNALSUB', False))
|
||||
kwargs = ast.literal_eval(os.getenv('SUBGEN_KWARGS', '{}') or '{}')
|
||||
try:
|
||||
kwargs = ast.literal_eval(os.getenv('SUBGEN_KWARGS', '{}') or '{}')
|
||||
except ValueError:
|
||||
kwargs = {}
|
||||
logging.info("kwargs (SUBGEN_KWARGS) is an invalid dictionary, defaulting to empty '{}'")
|
||||
|
||||
set_env_variables('subgen.env')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user