[pypy-commit] pypy ffi-backend: Translation fix

arigo noreply at buildbot.pypy.org
Sat Jul 7 17:38:06 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: ffi-backend
Changeset: r55968:e669e0dca277
Date: 2012-07-07 15:33 +0000
http://bitbucket.org/pypy/pypy/changeset/e669e0dca277/

Log:	Translation fix

diff --git a/pypy/module/_cffi_backend/cdataobj.py b/pypy/module/_cffi_backend/cdataobj.py
--- a/pypy/module/_cffi_backend/cdataobj.py
+++ b/pypy/module/_cffi_backend/cdataobj.py
@@ -79,11 +79,13 @@
             else:
                 return space.w_NotImplemented
 
-            if requires_ordering and (
-                    isinstance(self.ctype, W_CTypePrimitive) or
+            if requires_ordering:
+                if (isinstance(self.ctype, W_CTypePrimitive) or
                     isinstance(other.ctype, W_CTypePrimitive)):
-                raise OperationError(space.w_TypeError,
-                    space.wrap("cannot do comparison on a primitive cdata"))
+                    raise OperationError(space.w_TypeError,
+                        space.wrap("cannot do comparison on a primitive cdata"))
+                cdata1 = rffi.cast(lltype.Unsigned, cdata1)
+                cdata2 = rffi.cast(lltype.Unsigned, cdata2)
             return space.newbool(op(cdata1, cdata2))
         #
         return func_with_new_name(_cmp, name)


More information about the pypy-commit mailing list