summaryrefslogtreecommitdiff
path: root/net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch
diff options
context:
space:
mode:
Diffstat (limited to 'net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch')
-rw-r--r--net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch b/net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch
new file mode 100644
index 000000000000..fe40d190d1ba
--- /dev/null
+++ b/net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch
@@ -0,0 +1,31 @@
+From e8ff16123582eb9d5c321f5c7e652335abfba368 Mon Sep 17 00:00:00 2001
+From: Alexey Sokolov <alexey+znc@asokolov.org>
+Date: Sat, 23 May 2020 13:28:13 +0100
+Subject: [PATCH] Fix PY_SSIZE_T_CLEAN python warning
+
+---
+ .travis.yml | 2 +-
+ modules/modpython.cpp | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/modules/modpython.cpp b/modules/modpython.cpp
+index dfe53b5b6b..7bc76fc5c1 100644
+--- a/modules/modpython.cpp
++++ b/modules/modpython.cpp
+@@ -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");
+ }
+