Skip to content

Commit b2fd1a4

Browse files
committedOct 5, 2016
[processing] use cmp_to_key to ensure Python3 compatibility
Conflicts: python/plugins/processing/gui/wrappers.py
1 parent e04780a commit b2fd1a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎python/plugins/processing/gui/wrappers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import locale
3232
import os
33+
from functools import cmp_to_key
3334

3435
from qgis.core import QgsCoordinateReferenceSystem, QgsVectorLayer
3536
from qgis.PyQt.QtWidgets import QCheckBox, QComboBox, QLineEdit, QPlainTextEdit
@@ -813,7 +814,7 @@ def getFields(self):
813814
for field in self._layer.fields():
814815
if not fieldTypes or field.type() in fieldTypes:
815816
fieldNames.add(unicode(field.name()))
816-
return sorted(list(fieldNames), cmp=locale.strcoll)
817+
return sorted(list(fieldNames), key=cmp_to_key(locale.strcoll))
817818

818819
def setValue(self, value):
819820
if self.param.multiple:

0 commit comments

Comments
 (0)
Please sign in to comment.