]> git.saurik.com Git - apple/xnu.git/blobdiff - tools/lldbmacros/core/cvalue.py
xnu-6153.121.1.tar.gz
[apple/xnu.git] / tools / lldbmacros / core / cvalue.py
index e58c7752fd4947cb686857d0e41d03ca402d6773..bcebeb495144c6b376cf063076b8b5b951f0dcc9 100755 (executable)
@@ -49,7 +49,10 @@ class value(object):
                 other = long(other)
             return me.__cmp__(other)
         if type(other) is value:
-            return int(self).__cmp__(int(other))
+            try:
+                return int(self).__cmp__(int(other))
+            except TypeError: # Try promoting to long
+                return long(self).__cmp__(long(other))
         raise TypeError("Cannot compare value with type {}".format(type(other)))
     
     def __str__(self):