Skip to content

Commit 22791cf

Browse files
committed
Fix TypeError: 'cmp' is an invalid keyword argument for this function
1 parent 14ab5eb commit 22791cf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎python/plugins/db_manager/db_plugins/postgis/connector.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def getTables(self, schema=None, add_sys_tables=False):
331331
items.append(item)
332332
self._close_cursor(c)
333333

334-
return sorted(items, cmp=lambda x, y: cmp((x[2], x[1]), (y[2], y[1])))
334+
return sorted(items, key=cmp_to_key(lambda x, y: (x[1] > y[1]) - (x[1] < y[1])))
335335

336336
def getVectorTables(self, schema=None):
337337
""" get list of table with a geometry column

0 commit comments

Comments
 (0)