Makes the wsl_conf imune to None

This commit is contained in:
Carlos Nihelton 2022-12-16 12:58:22 +00:00
parent 4f0b45798b
commit 5319633d78
No known key found for this signature in database
GPG Key ID: 6FE346D245197E9A
1 changed files with 4 additions and 2 deletions

View File

@ -120,12 +120,14 @@ def wsl_config_update(config_class, root_dir):
"""
temp_conf_default = {}
temp_confname = config_class.__str__()
if temp_confname.startswith("WSLConfigurationBase"):
if temp_confname.startswith("None"):
return
elif temp_confname.startswith("WSLConfigurationBase"):
temp_conf_default = config_base_default
elif temp_confname.startswith("WSLConfigurationAdvanced"):
temp_conf_default = config_adv_default
else:
raise TypeError("Invalid type name.")
raise TypeError("Invalid type: {}".format(config_class))
# update the config file
for config_type in temp_conf_default: