Fix PY_SSIZE_T_CLEAN python warning

This commit is contained in:
Alexey Sokolov
2020-05-23 13:28:13 +01:00
parent b3b38956a7
commit e8ff161235
2 changed files with 3 additions and 2 deletions

View File

@@ -14,6 +14,7 @@
* limitations under the License.
*/
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <znc/Chan.h>
@@ -455,7 +456,7 @@ CBSOCK(ConnectionRefused);
void CPySocket::ReadData(const char* data, size_t len) {
PyObject* pyRes =
PyObject_CallMethod(m_pyObj, const_cast<char*>("OnReadData"),
const_cast<char*>("y#"), data, (int)len);
const_cast<char*>("y#"), data, (Py_ssize_t)len);
CHECKCLEARSOCK("OnReadData");
}