Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Fix "TypeError: sorted expected 1 arguments, got 2"
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaran committed Sep 10, 2019
1 parent fef2a43 commit c2789eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wicd/wnettools.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class BaseWirelessInterface() -- Control a wireless network interface.
import dbus
import socket, fcntl
import shutil
from functools import cmp_to_key

from . import wpath
from . import misc
Expand Down Expand Up @@ -1444,7 +1445,7 @@ def _ParseAccessPoint(self, cell, ralink_info):
m = re.findall(bitrates_pattern, bitrates)
if m:
# numeric sort
ap['bitrates'] = sorted(m, lambda x, y: int(float(x) - float(y)))
ap['bitrates'] = sorted(m, key=cmp_to_key(lambda x, y: int(float(x) - float(y))))
else:
ap['bitrates'] = None

Expand Down

0 comments on commit c2789eb

Please sign in to comment.