blob: 30ac9a66843658ce9ecc4bb0191c76e0ba849603 [file] [log] [blame]
Andrew Geissler615f2f12022-07-15 14:00:58 -05001From db8f1a7930c6b5826357646746337dafc983f953 Mon Sep 17 00:00:00 2001
2From: Ilya Etingof <etingof@gmail.com>
3Date: Sat, 21 Mar 2020 19:05:03 +0100
4Subject: [PATCH] Fix `DeprecationWarning: __int__ returned non-int` on Py3
5
6In `BitString.__int__()`
7Upstream-Status: Backport
8Signed-off-by: Yulong Liu <yulong.liu@windriver.com>
9---
10 pyasn1/type/univ.py | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py
14index 10924c3..488241f 100644
15--- a/pyasn1/type/univ.py
16+++ b/pyasn1/type/univ.py
17@@ -551,7 +551,7 @@ class BitString(base.SimpleAsn1Type):
18 return self.clone(SizedInteger(self._value >> count).setBitLength(max(0, len(self._value) - count)))
19
20 def __int__(self):
21- return self._value
22+ return int(self._value)
23
24 def __float__(self):
25 return float(self._value)
26--
272.25.1
28