Skip to content

Commit ca00174

Browse files
havatvnyalldawson
authored andcommittedAug 7, 2018
[processing] Update the comparison implementation in voronoi.py (fixes #18219)
When "translating" the cmp function of Site and Halfedge to Python 3, the __lt__ function was forgotten. It has been added.
1 parent 8700037 commit ca00174

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎python/plugins/processing/algs/qgis/voronoi.py

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def __lt__(self, other):
397397
return False
398398
elif self.x < other.x:
399399
return True
400-
elif self.x > other.x:
400+
else:
401401
return False
402402

403403
def distance(self, other):
@@ -512,7 +512,7 @@ def __lt__(self, other):
512512
return False
513513
elif self.vertex.x < other.vertex.x:
514514
return True
515-
elif self.vertex.x > other.vertex.x:
515+
else:
516516
return False
517517

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

0 commit comments

Comments
 (0)
Please sign in to comment.