mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Move the changing of the setting after import out of try-except
It should never give an exception, so if it does, crash and burn the application. Contributes to issue CURA-37.
This commit is contained in:
parent
edc2b2c7e2
commit
e23a9ea997
1 changed files with 3 additions and 2 deletions
|
@ -98,9 +98,10 @@ class LegacyProfileReader(ProfileReader):
|
||||||
compiled = compile(old_setting_expression, new_setting, "eval")
|
compiled = compile(old_setting_expression, new_setting, "eval")
|
||||||
try:
|
try:
|
||||||
new_value = eval(compiled, {"math": math}, legacy_settings) #Pass the legacy settings as local variables to allow access to in the evaluation.
|
new_value = eval(compiled, {"math": math}, legacy_settings) #Pass the legacy settings as local variables to allow access to in the evaluation.
|
||||||
if profile.getSettingValue(new_setting) != new_value: #Not equal to the default.
|
|
||||||
profile.setSettingValue(new_setting, new_value) #Store the setting in the profile!
|
|
||||||
except Exception as e: #Probably some setting name that was missing or something else that went wrong in the ini file.
|
except Exception as e: #Probably some setting name that was missing or something else that went wrong in the ini file.
|
||||||
Logger.log("w", "Setting " + new_setting + " could not be set because the evaluation failed. Something is probably missing from the imported legacy profile.")
|
Logger.log("w", "Setting " + new_setting + " could not be set because the evaluation failed. Something is probably missing from the imported legacy profile.")
|
||||||
|
continue
|
||||||
|
if profile.getSettingValue(new_setting) != new_value: #Not equal to the default.
|
||||||
|
profile.setSettingValue(new_setting, new_value) #Store the setting in the profile!
|
||||||
|
|
||||||
return profile
|
return profile
|
Loading…
Add table
Add a link
Reference in a new issue