Cleanup: avoid "nullptr" in Python strings & error messages
This is a C++ term not expected in exceptions and messages.
This commit is contained in:
@@ -4576,7 +4576,7 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
|
||||
bContext *C = static_cast<bContext *>(self->ptr->data);
|
||||
if (C == nullptr) {
|
||||
PyErr_Format(PyExc_AttributeError,
|
||||
"bpy_struct: Context is 'nullptr', cannot get \"%.200s\" from context",
|
||||
"bpy_struct: Context is 'null', cannot get \"%.200s\" from context",
|
||||
name);
|
||||
ret = nullptr;
|
||||
}
|
||||
@@ -4862,7 +4862,7 @@ static int pyrna_struct_setattro(BPy_StructRNA *self, PyObject *pyname, PyObject
|
||||
bContext *C = static_cast<bContext *>(self->ptr->data);
|
||||
if (C == nullptr) {
|
||||
PyErr_Format(PyExc_AttributeError,
|
||||
"bpy_struct: Context is 'nullptr', cannot set \"%.200s\" from context",
|
||||
"bpy_struct: Context is 'null', cannot set \"%.200s\" from context",
|
||||
name);
|
||||
return -1;
|
||||
}
|
||||
@@ -6653,14 +6653,14 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
|
||||
|
||||
if (self_ptr == nullptr) {
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"RNA functions internal RNA pointer is nullptr, this is a bug. aborting");
|
||||
"RNA functions internal RNA pointer is null, this is a bug. aborting");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (self_func == nullptr) {
|
||||
PyErr_Format(
|
||||
PyExc_RuntimeError,
|
||||
"%.200s.<unknown>(): RNA function internal function is nullptr, this is a bug. aborting",
|
||||
"%.200s.<unknown>(): RNA function internal function is null, this is a bug. aborting",
|
||||
RNA_struct_identifier(self_ptr->type));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -433,6 +433,9 @@ static char *copy_value_single(PyObject *item,
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* \param data: Data array, may be null.
|
||||
*/
|
||||
static char *copy_values(PyObject *seq,
|
||||
PointerRNA *ptr,
|
||||
PropertyRNA *prop,
|
||||
@@ -454,8 +457,6 @@ static char *copy_values(PyObject *seq,
|
||||
* validating but fails later somehow, so include checks for safety.
|
||||
*/
|
||||
|
||||
/* Note that 'data can be nullptr' */
|
||||
|
||||
if (seq_size == -1) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args)
|
||||
|
||||
if (handle == nullptr) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"callback_remove(handle): nullptr handle given, invalid or already removed");
|
||||
"callback_remove(handle): null handle given, invalid or already removed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ PyObject *pyrna_callback_classmethod_remove(PyObject * /*self*/, PyObject *args)
|
||||
handle = PyCapsule_GetPointer(py_handle, rna_capsual_id);
|
||||
if (handle == nullptr) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"callback_remove(handler): nullptr handler given, invalid or already removed");
|
||||
"callback_remove(handler): null handler given, invalid or already removed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user