-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
|
||
static void assertValid(PyObject *obj) | ||
{ | ||
#ifndef Py_GIL_DISABLED | ||
if (Py_REFCNT(obj) >= 1) | ||
return; | ||
|
||
|
@@ -34,6 +35,9 @@ static void assertValid(PyObject *obj) | |
JP_TRACE_PY("pyref FAULT", obj); | ||
JP_RAISE(PyExc_SystemError, "Deleted reference"); | ||
// GCOVR_EXCL_STOP | ||
#else | ||
return; // GIL is disabled; we assume obj is valid | ||
This comment has been minimized.
Sorry, something went wrong.
astrelsky
Contributor
|
||
#endif | ||
} | ||
|
||
/** | ||
|
Perhaps it would be cleaner to make a GET_REF macro in the header file an then just use it throughout the code.