Cleanup: replace Py_CLEAR with Py_DECREF in bpy.app modules

In this case, there is no benefit to using Py_CLEAR
as the value will never be NULL and can't be used later on.
This commit is contained in:
2021-03-04 15:46:07 +11:00
parent a40ccde405
commit 24f0807550
9 changed files with 17 additions and 17 deletions

View File

@@ -216,7 +216,7 @@ static PyObject *make_app_info(void)
#undef SetObjItem
if (PyErr_Occurred()) {
Py_CLEAR(app_info);
Py_DECREF(app_info);
return NULL;
}
return app_info;

View File

@@ -79,8 +79,8 @@ static PyObject *make_alembic_info(void)
SetStrItem("Unknown");
#endif
if (PyErr_Occurred()) {
Py_CLEAR(alembic_info);
if (UNLIKELY(PyErr_Occurred())) {
Py_DECREF(alembic_info);
return NULL;
}

View File

@@ -116,8 +116,8 @@ static PyObject *make_ffmpeg_info(void)
#undef FFMPEG_LIB_VERSION
if (PyErr_Occurred()) {
Py_CLEAR(ffmpeg_info);
if (UNLIKELY(PyErr_Occurred())) {
Py_DECREF(ffmpeg_info);
return NULL;
}

View File

@@ -81,8 +81,8 @@ static PyObject *make_ocio_info(void)
SetStrItem("Unknown");
#endif
if (PyErr_Occurred()) {
Py_CLEAR(ocio_info);
if (UNLIKELY(PyErr_Occurred())) {
Py_DECREF(ocio_info);
return NULL;
}

View File

@@ -77,8 +77,8 @@ static PyObject *make_oiio_info(void)
SetStrItem("Unknown");
#endif
if (PyErr_Occurred()) {
Py_CLEAR(oiio_info);
if (UNLIKELY(PyErr_Occurred())) {
Py_DECREF(oiio_info);
return NULL;
}

View File

@@ -74,8 +74,8 @@ static PyObject *make_opensubdiv_info(void)
SetStrItem("Unknown");
#endif
if (PyErr_Occurred()) {
Py_CLEAR(opensubdiv_info);
if (UNLIKELY(PyErr_Occurred())) {
Py_DECREF(opensubdiv_info);
return NULL;
}

View File

@@ -81,8 +81,8 @@ static PyObject *make_openvdb_info(void)
SetStrItem("Unknown");
#endif
if (PyErr_Occurred()) {
Py_CLEAR(openvdb_info);
if (UNLIKELY(PyErr_Occurred())) {
Py_DECREF(openvdb_info);
return NULL;
}

View File

@@ -114,8 +114,8 @@ static PyObject *make_sdl_info(void)
SetObjItem(PyBool_FromLong(0));
#endif
if (PyErr_Occurred()) {
Py_CLEAR(sdl_info);
if (UNLIKELY(PyErr_Occurred())) {
Py_DECREF(sdl_info);
return NULL;
}

View File

@@ -80,8 +80,8 @@ static PyObject *make_usd_info(void)
SetStrItem("Unknown");
#endif
if (PyErr_Occurred()) {
Py_CLEAR(usd_info);
if (UNLIKELY(PyErr_Occurred())) {
Py_DECREF(usd_info);
return NULL;
}