Skip to content

Commit

Permalink
Add check for invalid kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
McCloudS authored Aug 3, 2024
1 parent c1d2e0d commit bdd5fd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion subgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit bdd5fd2

Please sign in to comment.