Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r2711:490ae5a1fe32
Date: 2016-06-05 23:25 +0200
http://bitbucket.org/cffi/cffi/changeset/490ae5a1fe32/

Log:    Python3 compat

diff --git a/c/lib_obj.c b/c/lib_obj.c
--- a/c/lib_obj.c
+++ b/c/lib_obj.c
@@ -119,7 +119,7 @@
        by calling _cffi_type().
     */
     PyObject *result = NULL;
-    CTypeDescrObject **pfargs;
+    CTypeDescrObject **pfargs = NULL;
     CTypeDescrObject *fresult;
     Py_ssize_t nargs = 0;
     struct CPyExtFunc_s *xfunc;
diff --git a/cffi/backend_ctypes.py b/cffi/backend_ctypes.py
--- a/cffi/backend_ctypes.py
+++ b/cffi/backend_ctypes.py
@@ -205,9 +205,7 @@
 
     def __nonzero__(self):
         return bool(self._address)
-    
-    def __bool__(self):
-        return bool(self._address)
+    __bool__ = __nonzero__
 
     @classmethod
     def _to_ctypes(cls, value):
@@ -465,6 +463,7 @@
             else:
                 def __nonzero__(self):
                     return self._value != 0
+            __bool__ = __nonzero__
 
             if kind == 'float':
                 @staticmethod
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to