From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/m2crypto/, dev-python/m2crypto/files/
Date: Sun, 13 Jun 2021 13:14:22 +0000 (UTC) [thread overview]
Message-ID: <1623590058.75de7f050246aaad0bf29cd909fc729b7d8fe417.mgorny@gentoo> (raw)
commit: 75de7f050246aaad0bf29cd909fc729b7d8fe417
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 13 13:13:31 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jun 13 13:14:18 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75de7f05
dev-python/m2crypto: Enable py3.10
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../m2crypto/files/m2crypto-0.37.1-py310.patch | 119 +++++++++++++++++++++
dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild | 3 +-
2 files changed, 121 insertions(+), 1 deletion(-)
diff --git a/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch b/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch
new file mode 100644
index 00000000000..f9be349fc3d
--- /dev/null
+++ b/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch
@@ -0,0 +1,119 @@
+diff --git a/SWIG/_bio.i b/SWIG/_bio.i
+index 84b76b3..6c090a4 100644
+--- a/SWIG/_bio.i
++++ b/SWIG/_bio.i
+@@ -246,8 +246,8 @@ PyObject *bio_set_cipher(BIO *b, EVP_CIPHER *c, PyObject *key, PyObject *iv, int
+ const void *kbuf, *ibuf;
+ Py_ssize_t klen, ilen;
+
+- if ((PyObject_AsReadBuffer(key, &kbuf, &klen) == -1)
+- || (PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1))
++ if ((m2_PyObject_AsReadBuffer(key, &kbuf, &klen) == -1)
++ || (m2_PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1))
+ return NULL;
+
+ BIO_set_cipher(b, (const EVP_CIPHER *)c,
+diff --git a/SWIG/_ec.i b/SWIG/_ec.i
+index f47d593..a492f6f 100644
+--- a/SWIG/_ec.i
++++ b/SWIG/_ec.i
+@@ -466,7 +466,7 @@ EC_KEY* ec_key_from_pubkey_der(PyObject *pubkey) {
+ const unsigned char *tempBuf;
+ EC_KEY *keypair;
+
+- if (PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
++ if (m2_PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
+ {
+ return NULL;
+ }
+@@ -486,7 +486,7 @@ EC_KEY* ec_key_from_pubkey_params(int nid, PyObject *pubkey) {
+ const unsigned char *tempBuf;
+ EC_KEY *keypair;
+
+- if (PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
++ if (m2_PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
+ {
+ return NULL;
+ }
+diff --git a/SWIG/_lib.i b/SWIG/_lib.i
+index 954e99b..351134b 100644
+--- a/SWIG/_lib.i
++++ b/SWIG/_lib.i
+@@ -137,8 +137,8 @@ m2_PyObject_AsReadBuffer(PyObject * obj, const void **buffer,
+ len = view.len;
+ }
+ } else {
+- if ((ret = PyObject_AsReadBuffer(obj, buffer, &len)) != 0)
+- return ret;
++ PyErr_SetString(PyExc_TypeError, "expected a readable buffer object");
++ return -1;
+ }
+ if (len > INT_MAX) {
+ m2_PyBuffer_Release(obj, &view);
+@@ -171,11 +171,8 @@ static int m2_PyObject_GetBufferInt(PyObject *obj, Py_buffer *view, int flags)
+ if (PyObject_CheckBuffer(obj))
+ ret = PyObject_GetBuffer(obj, view, flags);
+ else {
+- const void *buf;
+-
+- ret = PyObject_AsReadBuffer(obj, &buf, &view->len);
+- if (ret == 0)
+- view->buf = (void *)buf;
++ PyErr_SetString(PyExc_TypeError, "expected a readable buffer object");
++ return -1;
+ }
+ if (ret)
+ return ret;
+@@ -633,7 +630,7 @@ BIGNUM *hex_to_bn(PyObject *value) {
+ }
+ }
+ else {
+- if (PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
++ if (m2_PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
+ return NULL;
+ }
+
+@@ -665,7 +662,7 @@ BIGNUM *dec_to_bn(PyObject *value) {
+ }
+ }
+ else {
+- if (PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
++ if (m2_PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
+ return NULL;
+ }
+
+diff --git a/SWIG/_rc4.i b/SWIG/_rc4.i
+index eb4747e..6af2dc6 100644
+--- a/SWIG/_rc4.i
++++ b/SWIG/_rc4.i
+@@ -46,7 +46,7 @@ PyObject *rc4_update(RC4_KEY *key, PyObject *in) {
+ Py_ssize_t len;
+ void *out;
+
+- if (PyObject_AsReadBuffer(in, &buf, &len) == -1)
++ if (m2_PyObject_AsReadBuffer(in, &buf, &len) == -1)
+ return NULL;
+
+ if (!(out = PyMem_Malloc(len))) {
+diff --git a/SWIG/_util.i b/SWIG/_util.i
+index bc2ee61..18e446a 100644
+--- a/SWIG/_util.i
++++ b/SWIG/_util.i
+@@ -22,7 +22,7 @@ PyObject *util_hex_to_string(PyObject *blob) {
+ char *ret;
+ Py_ssize_t len;
+
+- if (PyObject_AsReadBuffer(blob, &buf, &len) == -1)
++ if (m2_PyObject_AsReadBuffer(blob, &buf, &len) == -1)
+ return NULL;
+
+ ret = hex_to_string((unsigned char *)buf, len);
+@@ -44,7 +44,7 @@ PyObject *util_string_to_hex(PyObject *blob) {
+ Py_ssize_t len0;
+ long len;
+
+- if (PyObject_AsReadBuffer(blob, &buf, &len0) == -1)
++ if (m2_PyObject_AsReadBuffer(blob, &buf, &len0) == -1)
+ return NULL;
+
+ len = len0;
diff --git a/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild b/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild
index b6c17695032..86a23528664 100644
--- a/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild
+++ b/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{8..10} )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1 toolchain-funcs
@@ -31,6 +31,7 @@ DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${P}-openssl-fixes.patch"
+ "${FILESDIR}/${P}-py310.patch"
)
swig_define() {
next reply other threads:[~2021-06-13 13:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-13 13:14 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-06-20 13:44 [gentoo-commits] repo/gentoo:master commit in: dev-python/m2crypto/, dev-python/m2crypto/files/ Andreas Sturmlechner
2019-04-18 15:11 Mike Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1623590058.75de7f050246aaad0bf29cd909fc729b7d8fe417.mgorny@gentoo \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox