diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 13:41:06 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 14:38:07 +0300 |
commit | 3d48d99647b59a6f0461baa4456660917f1bbda6 (patch) | |
tree | 0183ca55640e5d8034ac59865ebc5a5071d29f1f /source/blender/python/intern/bpy_app_handlers.c | |
parent | 44b7354742ef3728f212edac1277c0d25fa59934 (diff) |
Cleanup: Python, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/python` module.
No functional changes.
Diffstat (limited to 'source/blender/python/intern/bpy_app_handlers.c')
-rw-r--r-- | source/blender/python/intern/bpy_app_handlers.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index dde1d13477f..cdbd3bc0b9c 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -118,22 +118,20 @@ static PyObject *bpy_app_handlers_persistent_new(PyTypeObject *UNUSED(type), "get the dictionary from the function passed"); return NULL; } - else { - /* set id */ - if (*dict_ptr == NULL) { - *dict_ptr = PyDict_New(); - } - PyDict_SetItemString(*dict_ptr, PERMINENT_CB_ID, Py_None); + /* set id */ + if (*dict_ptr == NULL) { + *dict_ptr = PyDict_New(); } + PyDict_SetItemString(*dict_ptr, PERMINENT_CB_ID, Py_None); + Py_INCREF(value); return value; } - else { - PyErr_SetString(PyExc_ValueError, "bpy.app.handlers.persistent expected a function"); - return NULL; - } + + PyErr_SetString(PyExc_ValueError, "bpy.app.handlers.persistent expected a function"); + return NULL; } /* dummy type because decorators can't be PyCFunctions */ |