[pypy-commit] cffi release-1.13: Don't return a bool from __int__(), as it raises a (Pending?)DeprecationWarning

arigo pypy.commits at gmail.com
Fri Sep 20 13:25:04 EDT 2019


Author: Armin Rigo <arigo at tunes.org>
Branch: release-1.13
Changeset: r3291:e295aee5c3ab
Date: 2019-09-20 19:24 +0200
http://bitbucket.org/cffi/cffi/changeset/e295aee5c3ab/

Log:	Don't return a bool from __int__(), as it raises a
	(Pending?)DeprecationWarning

diff --git a/cffi/backend_ctypes.py b/cffi/backend_ctypes.py
--- a/cffi/backend_ctypes.py
+++ b/cffi/backend_ctypes.py
@@ -403,7 +403,7 @@
                         source = _cast_source_to_int(source)
                     return cls(bool(source))
                 def __int__(self):
-                    return self._value
+                    return int(self._value)
 
             if kind == 'char':
                 @classmethod


More information about the pypy-commit mailing list