PyAPI: support passing None to imbuf.load(..) for consistency

Support a None argument which has the same behavior as not passing the
argument in. This matches bpy.data.temp_data behavior.
This commit is contained in:
Campbell Barton
2023-08-11 15:14:56 +10:00
parent ac43b5ec80
commit 5ed81a957a

View File

@@ -541,7 +541,7 @@ PyDoc_STRVAR(
" :arg image: the image to write.\n"
" :type image: :class:`ImBuf`\n"
" :arg filepath: Optional filepath of the image (fallback to the images file path).\n"
" :type filepath: string or bytes\n");
" :type filepath: string, bytes or NoneType\n");
static PyObject *M_imbuf_write(PyObject * /*self*/, PyObject *args, PyObject *kw)
{
Py_ImBuf *py_imb;
@@ -561,7 +561,7 @@ static PyObject *M_imbuf_write(PyObject * /*self*/, PyObject *args, PyObject *kw
&_parser,
&Py_ImBuf_Type,
&py_imb,
PyC_ParseUnicodeAsBytesAndSize,
PyC_ParseUnicodeAsBytesAndSize_OrNone,
&filepath_data))
{
return nullptr;