From ef352cc8f35117f8334b8b980dd5cfdc10dc732b Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Sun, 30 May 2021 21:13:52 -0700 Subject: [PATCH] Build fix for Python wrapper --- src/bindings/python/PythonSockets.cxx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/bindings/python/PythonSockets.cxx b/src/bindings/python/PythonSockets.cxx index f7bf49a..abdff7e 100644 --- a/src/bindings/python/PythonSockets.cxx +++ b/src/bindings/python/PythonSockets.cxx @@ -37,12 +37,11 @@ #include "lwip/inet.h" #include "lwip/sockets.h" #include "structmember.h" // PyMemberDef -#include "sysmodule.h" -#include "pytime.h" #include #include + PyObject* set_error(void) { return NULL; // PyErr_SetFromErrno(zts_errno); @@ -329,13 +328,13 @@ PyObject* zts_py_select(PyObject* module, PyObject* rlist, PyObject* wlist, PyOb tvp = (struct timeval*)NULL; } else { - if (_PyTime_FromSecondsObject(&timeout, timeout_obj, _PyTime_ROUND_TIMEOUT) < 0) { + if (_PyTime_FromSecondsObject(&timeout, timeout_obj, _PyTime_ROUND_UP) < 0) { if (PyErr_ExceptionMatches(PyExc_TypeError)) { PyErr_SetString(PyExc_TypeError, "timeout must be a float or None"); } return NULL; } - if (_PyTime_AsTimeval(timeout, &tv, _PyTime_ROUND_TIMEOUT) == -1) { + if (_PyTime_AsTimeval(timeout, &tv, _PyTime_ROUND_UP) == -1) { return NULL; } if (tv.tv_sec < 0) { @@ -528,9 +527,7 @@ PyObject* zts_py_fcntl(int fd, int code, PyObject* arg) { unsigned int int_arg = 0; int ret; - if (PySys_Audit("fcntl.fcntl", "iiO", fd, code, arg ? arg : Py_None) < 0) { - return NULL; - } + if (arg != NULL) { int parse_result; PyErr_Clear(); @@ -564,10 +561,6 @@ PyObject* zts_py_ioctl(int fd, unsigned int code, PyObject* ob_arg, int mutate_a Py_ssize_t len; char buf[IOCTL_BUFSZ + 1]; /* argument plus NUL byte */ - if (PySys_Audit("fcntl.ioctl", "iIO", fd, code, ob_arg ? ob_arg : Py_None) < 0) { - return NULL; - } - if (ob_arg != NULL) { if (PyArg_Parse(ob_arg, "w*:ioctl", &pstr)) { char* arg;