Jython dislikes __cmp__ methods that don't return ints
------------------------------------------------------

                 Key: QPID-1383
                 URL: https://issues.apache.org/jira/browse/QPID-1383
             Project: Qpid
          Issue Type: Bug
          Components: Python Client
    Affects Versions: M3
         Environment: [EMAIL PROTECTED] jython2.5a3]$ ./jython --version
Jython 2.5a3 (trunk:5315:5317, Sep 10 2008, 20:54:23) 
[IcedTea Server VM (Sun Microsystems Inc.)] on java1.7.0
[EMAIL PROTECTED] jython2.5a3]$ uname -a
Linux localhost.localdomain 2.6.25.14-69.fc8 #1 SMP Mon Aug 4 14:20:24 EDT 2008 
i686 i686 i386 GNU/Linux
[EMAIL PROTECTED] jython2.5a3]$ cat /etc/redhat-release 
Fedora release 8 (Werewolf)

            Reporter: Justin Ross


Jython complains that Serial.__cmp__ does not return an int.  In fact, it's 
returning a python "long int".  Here's a fix:

Index: python/qpid/datatypes.py
===================================================================
--- python/qpid/datatypes.py    (revision 704116)
+++ python/qpid/datatypes.py    (working copy)
@@ -138,7 +138,7 @@
 
     delta = (self.value - other.value) & 0xFFFFFFFF
     neg = delta & 0x80000000
-    mag = delta & 0x7FFFFFFF
+    mag = int(delta & 0x7FFFFFFF)
 
     if neg:
       return -mag

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to