You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Justin Ross (JIRA)" <qp...@incubator.apache.org> on 2008/10/22 00:46:44 UTC

[jira] Created: (QPID-1383) Jython dislikes __cmp__ methods that don't return ints

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: [jross@localhost 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
[jross@localhost 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
[jross@localhost 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.