Fixed bad try/except/finally block
This commit is contained in:
parent
41003e1e83
commit
959c7a0929
1 changed files with 5 additions and 6 deletions
|
@ -175,13 +175,12 @@ def get(name, import_str=False):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
if name in default_settings.required_attrs:
|
if name in default_settings.required_attrs:
|
||||||
raise Exception('You must set ' + name + ' in your settings.')
|
raise Exception('You must set ' + name + ' in your settings.')
|
||||||
finally:
|
|
||||||
if isinstance(default_value, dict) and value:
|
if isinstance(default_value, dict) and value:
|
||||||
default_value.update(value)
|
default_value.update(value)
|
||||||
value = default_value
|
value = default_value
|
||||||
|
else:
|
||||||
value = value or default_value
|
value = value or default_value
|
||||||
|
|
||||||
value = import_from_str(value) if import_str else value
|
value = import_from_str(value) if import_str else value
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
Loading…
Reference in a new issue