Skip to content

Commit

Permalink
[processing] use cmp_to_key to ensure Python3 compatibility
Browse files Browse the repository at this point in the history
Conflicts:
	python/plugins/processing/gui/wrappers.py
  • Loading branch information
volaya committed Oct 5, 2016
1 parent e04780a commit b2fd1a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/plugins/processing/gui/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import locale
import os
from functools import cmp_to_key

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

def setValue(self, value):
if self.param.multiple:
Expand Down

0 comments on commit b2fd1a4

Please sign in to comment.