mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 04:29:02 -04:00
Python: allocate py_req in the http_request_free hook if needed.
Makes it possible to mix on_free with other runtimes.
This commit is contained in:
parent
e545657023
commit
a3800fa57e
@ -1331,8 +1331,10 @@ python_runtime_http_request_free(void *addr, struct http_request *req)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
if (req->py_req == NULL)
|
||||
fatal("%s: py_req is NULL", __func__);
|
||||
if (req->py_req == NULL) {
|
||||
if ((req->py_req = pyhttp_request_alloc(req)) == NULL)
|
||||
fatal("%s: pyreq alloc failed", __func__);
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
ret = PyObject_CallFunctionObjArgs(addr, req->py_req, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user