Skip to content

Commit

Permalink
[processing] Update the comparison implementation in voronoi.py (fixes
Browse files Browse the repository at this point in the history
…#18219)

When "translating" the cmp function of Site and Halfedge to Python 3, the __lt__ function was forgotten.  It has been added.
  • Loading branch information
havatv authored and nyalldawson committed Aug 7, 2018
1 parent 8700037 commit ca00174
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/plugins/processing/algs/qgis/voronoi.py 100644 → 100755
Expand Up @@ -397,7 +397,7 @@ def __lt__(self, other):
return False
elif self.x < other.x:
return True
elif self.x > other.x:
else:
return False

def distance(self, other):
Expand Down Expand Up @@ -512,7 +512,7 @@ def __lt__(self, other):
return False
elif self.vertex.x < other.vertex.x:
return True
elif self.vertex.x > other.vertex.x:
else:
return False

def leftreg(self, default):
Expand Down Expand Up @@ -905,4 +905,4 @@ def cmp(a, b):
In python 2 cmp() was a built in function but in python 3 is gone.
"""
return (a > b) - (a < b)
return (b < a) - (a < b)

0 comments on commit ca00174

Please sign in to comment.