Cleanup: return a boolean from BPY_context_member_get, check it's result

This commit is contained in:
Campbell Barton
2025-06-26 14:27:17 +10:00
parent 06dfab455a
commit c71b314565
3 changed files with 16 additions and 12 deletions

View File

@@ -102,7 +102,11 @@ float BPY_driver_exec(PathResolvedRNA *anim_rna,
void BPY_DECREF(void *pyob_ptr);
void BPY_DECREF_RNA_INVALIDATE(void *pyob_ptr);
int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *result);
/**
* \return true when `member` was found.
* Note that this can include a "None" value.
*/
bool BPY_context_member_get(bContext *C, const char *member, bContextDataResult *result);
void BPY_context_set(bContext *C);
/**
* Use for updating while a python script runs - in case of file load.

View File

@@ -727,7 +727,7 @@ void BPY_modules_load_user(bContext *C)
bpy_context_clear(C, &gilstate);
}
int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *result)
bool BPY_context_member_get(bContext *C, const char *member, bContextDataResult *result)
{
PyGILState_STATE gilstate;
const bool use_gil = !PyC_IsInterpreterActive();