Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/gpu/gpu_py_element.c')
-rw-r--r--source/blender/python/gpu/gpu_py_element.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/source/blender/python/gpu/gpu_py_element.c b/source/blender/python/gpu/gpu_py_element.c
index 0c4cd1d815b..379cd0836ca 100644
--- a/source/blender/python/gpu/gpu_py_element.c
+++ b/source/blender/python/gpu/gpu_py_element.c
@@ -91,17 +91,11 @@ static PyObject *bpygpu_IndexBuf_new(PyTypeObject *UNUSED(type), PyObject *args,
return NULL;
}
- bool format_error = pybuffer.itemsize != 4;
+ if (pybuffer.itemsize != 4 ||
+ PyC_Formatstr_is_float(PyC_Formatstr_get(pybuffer.format)))
{
- char format = FORMAT_STR_GET(pybuffer.format);
- if (FORMAT_STR_IS_FLOAT(format)) {
- format_error = true;
- }
- }
-
- if (format_error) {
PyErr_Format(PyExc_ValueError,
- "Each index must be an integer value with 4 bytes in size");
+ "Each index must be an 4-bytes integer value");
return NULL;
}