summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python
diff options
context:
space:
mode:
authorYulong (Kevin) Liu <Yulong.Liu@windriver.com>2022-06-15 12:41:27 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-17 17:57:39 +0100
commitac674d95820137306e7c71f4275d92cf4fedf39d (patch)
tree752044a67d6031a0d3dacb7698722b3fe97e8ea6 /meta/recipes-devtools/python
parentbaa0ecf3271008cf60cd830c54a71f191aebb81c (diff)
downloadopenembedded-core-contrib-ac674d95820137306e7c71f4275d92cf4fedf39d.tar.gz
python3-pyasn1: Eliminated ptest deprecation warnings
Eliminated the ptest deprecation warnings for the error: DeprecationWarning: _int_ returned non-int (type SizedInteger). The ability to return an instance of a strict subclass of int is deprecated, and may be removed in a future version of Python. return SizedInteger(value).setBitLength(len(value)) Patch from git upstream repo: https://github.com/etingof/pyasn1/commit/db8f1a7930c6b5826357646746337dafc983f953 Signed-off-by: Yulong (Kevin) Liu <yulong.liu@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r--meta/recipes-devtools/python/python-pyasn1.inc1
-rw-r--r--meta/recipes-devtools/python/python3-pyasn1/0001-Fix-DeprecationWarning-__int__-returned-non-int-on-P.patch28
2 files changed, 29 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-pyasn1.inc b/meta/recipes-devtools/python/python-pyasn1.inc
index 6cbed0fcd5..1b941630e7 100644
--- a/meta/recipes-devtools/python/python-pyasn1.inc
+++ b/meta/recipes-devtools/python/python-pyasn1.inc
@@ -19,6 +19,7 @@ inherit ptest
SRC_URI += " \
file://run-ptest \
+ file://0001-Fix-DeprecationWarning-__int__-returned-non-int-on-P.patch \
"
RDEPENDS:${PN}-ptest += " \
diff --git a/meta/recipes-devtools/python/python3-pyasn1/0001-Fix-DeprecationWarning-__int__-returned-non-int-on-P.patch b/meta/recipes-devtools/python/python3-pyasn1/0001-Fix-DeprecationWarning-__int__-returned-non-int-on-P.patch
new file mode 100644
index 0000000000..30ac9a6684
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-pyasn1/0001-Fix-DeprecationWarning-__int__-returned-non-int-on-P.patch
@@ -0,0 +1,28 @@
+From db8f1a7930c6b5826357646746337dafc983f953 Mon Sep 17 00:00:00 2001
+From: Ilya Etingof <etingof@gmail.com>
+Date: Sat, 21 Mar 2020 19:05:03 +0100
+Subject: [PATCH] Fix `DeprecationWarning: __int__ returned non-int` on Py3
+
+In `BitString.__int__()`
+Upstream-Status: Backport
+Signed-off-by: Yulong Liu <yulong.liu@windriver.com>
+---
+ pyasn1/type/univ.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py
+index 10924c3..488241f 100644
+--- a/pyasn1/type/univ.py
++++ b/pyasn1/type/univ.py
+@@ -551,7 +551,7 @@ class BitString(base.SimpleAsn1Type):
+ return self.clone(SizedInteger(self._value >> count).setBitLength(max(0, len(self._value) - count)))
+
+ def __int__(self):
+- return self._value
++ return int(self._value)
+
+ def __float__(self):
+ return float(self._value)
+--
+2.25.1
+