Skip to content

Commit

Permalink
Fix PY_SSIZE_T_CLEAN python warning
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthGandalf committed May 23, 2020
1 parent b3b3895 commit e8ff161
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion modules/modpython.cpp
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>

#include <znc/Chan.h>
Expand Down Expand Up @@ -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");
}

Expand Down

0 comments on commit e8ff161

Please sign in to comment.