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
+1 -1
View File
@@ -135,7 +135,7 @@ script:
- env LLVM_PROFILE_FILE="$PWD/unittest.profraw" make VERBOSE=1 unittest
- sudo make install
# TODO: use DEVEL_COVER_OPTIONS for https://metacpan.org/pod/Devel::Cover
- env LLVM_PROFILE_FILE="$PWD/inttest.profraw" ZNC_MODPERL_COVERAGE_OPTS="-db,$PWD/cover_db" make VERBOSE=1 inttest
- env LLVM_PROFILE_FILE="$PWD/inttest.profraw" ZNC_MODPERL_COVERAGE_OPTS="-db,$PWD/cover_db" PYTHONWARNINGS=error make VERBOSE=1 inttest
- /usr/local/bin/znc --version
after_success:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ~/perl5/bin/cover --no-gcov --report=clover; fi
+2 -1
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");
}