Python: avoid mutable default param values

D1328 by @yedpodtrzitko
This commit is contained in:
Campbell Barton
2015-05-31 15:56:22 +10:00
parent 67bebc42f4
commit f5a471ef86
3 changed files with 31 additions and 20 deletions

View File

@@ -416,19 +416,21 @@ def reset_all(reload_scripts=False):
disable(mod_name)
def module_bl_info(mod, info_basis={"name": "",
"author": "",
"version": (),
"blender": (),
"location": "",
"description": "",
"wiki_url": "",
"support": 'COMMUNITY',
"category": "",
"warning": "",
"show_expanded": False,
}
):
def module_bl_info(mod, info_basis=None):
if info_basis is None:
info_basis = {
"name": "",
"author": "",
"version": (),
"blender": (),
"location": "",
"description": "",
"wiki_url": "",
"support": 'COMMUNITY',
"category": "",
"warning": "",
"show_expanded": False,
}
addon_info = getattr(mod, "bl_info", {})