# HG changeset patch # User Ilya Etingof <etingof@gmail.com> # Date 1584813903 -3600 # Sat Mar 21 19:05:03 2020 +0100 # Node ID e5b089c8d9fbc162f3519b6ae9862dfe2bd117b8 # Parent 3e26583bfd83b21b9828d29bb3f6c772f3bea200 Fix `DeprecationWarning: __int__ returned non-int` on Py3 In `BitString.__int__()` diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py --- a/pyasn1/type/univ.py +++ b/pyasn1/type/univ.py @@ -551,7 +551,7 @@ 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)