Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
fix cmp function for python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
simlmx committed Feb 18, 2016
1 parent dcee951 commit 9ac40c9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ib/ext/Util.py
Expand Up @@ -7,12 +7,16 @@
# WARNING: all changes to this file will be lost.

from ib.lib import Double, Integer
#
#
# * Util.java
#
#
# package: com.ib.client


# Making sure this works in python3 as well
def cmp(a, b):
return (a > b) - (a < b)

class Util(object):
""" generated source for class Util """
@classmethod
Expand Down Expand Up @@ -53,7 +57,7 @@ def VectorEqualsUnordered(cls, lhs, rhs):
rhsIdx = 0
while rhsIdx < rhsCount:
if matchedRhsElems[rhsIdx]:
continue
continue
if lhsElem == rhs[rhsIdx]:
matchedRhsElems[rhsIdx] = True
break
Expand All @@ -73,4 +77,3 @@ def IntMaxString(cls, value):
def DoubleMaxString(cls, value):
""" generated source for method DoubleMaxString """
return "" if (value == Double.MAX_VALUE) else str(value)

0 comments on commit 9ac40c9

Please sign in to comment.