Skip to content

Commit f41c740

Browse files
authored
Fix missed Py_INCREF(Py_None) in driver.c (#5095)
From: https://docs.python.org/3.10/c-api/none.html#c.Py_RETURN_NONE `Properly handle returning [Py_None](https://docs.python.org/3.10/c-api/none.html#c.Py_None) from within a C function (that is, increment the reference count of None and return it.)`
1 parent 01a252c commit f41c740

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

third_party/intel/backend/driver.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,7 @@ extern "C" EXPORT_FUNC PyObject *wait_on_sycl_queue(PyObject *cap) {
360360
return NULL;
361361
sycl::queue *sycl_queue = static_cast<sycl::queue *>(queue);
362362
sycl_queue->wait();
363-
364-
return Py_None;
363+
Py_RETURN_NONE;
365364
}
366365

367366
extern "C" EXPORT_FUNC PyObject *has_opencl_extension(int device_id,

0 commit comments

Comments
 (0)