commit 3925ba60adf567ea044074a02dfffd652426c5f9
parent 4cc9e216bb85945964b173f18442c517bdac296e
Author: Joris Vink <joris@coders.se>
Date: Mon, 12 Nov 2018 09:00:36 +0100
don't call close() no underlying socket.
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/python.c b/src/python.c
@@ -173,6 +173,8 @@ static struct python_coro *coro_running = NULL;
void
kore_python_init(void)
{
+ struct kore_runtime_call *rcall;
+
coro_id = 0;
coro_count = 0;
@@ -199,6 +201,12 @@ kore_python_init(void)
if (PyImport_AppendInittab("kore", &python_module_init) == -1)
fatal("kore_python_init: failed to add new module");
+ rcall = kore_runtime_getcall("kore_python_preinit");
+ if (rcall != NULL) {
+ kore_runtime_execute(rcall);
+ kore_free(rcall);
+ }
+
Py_Initialize();
}
@@ -1589,7 +1597,6 @@ static PyObject *
pysocket_close(struct pysocket *sock, PyObject *args)
{
if (sock->socket != NULL) {
- (void)PyObject_CallMethod(sock->socket, "close", NULL);
Py_DECREF(sock->socket);
sock->socket = NULL;
} else if (sock->fd != -1) {