summaryrefslogtreecommitdiff
path: root/xgps
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-04-08 10:07:45 -0700
committerEric S. Raymond <esr@thyrsus.com>2016-04-09 04:39:15 -0400
commite818ba3a132cc233fd24126802bbbdcafd0fa6d5 (patch)
tree7aa03bbd1c8ec647503c0dc5e266ee1b433ac965 /xgps
parent47c82fdffad20d946d3f485ff03f25d844f925d8 (diff)
downloadgpsd-e818ba3a132cc233fd24126802bbbdcafd0fa6d5.tar.gz
Fixes xgps for Python 3.
This replaces the obsolete 'cmp' keyword for 'sorted' with the still-available (and more efficient) 'key' keyword. TESTED: Ran xgps with Python 2.7, 3.3, 3.4, and 3.5 (with appropriate builds).
Diffstat (limited to 'xgps')
-rwxr-xr-xxgps2
1 files changed, 1 insertions, 1 deletions
diff --git a/xgps b/xgps
index c7955b4b..79fd3fb2 100755
--- a/xgps
+++ b/xgps
@@ -785,7 +785,7 @@ class Base:
fld = fld[1:]
satellites = sorted(
satellites[:],
- cmp=lambda x, y: cmp(x[fld], y[fld]), reverse=rev)
+ key=lambda x: x[fld], reverse=rev)
for (i, satellite) in enumerate(satellites):
self.set_satlist_field(i, 0, satellite.PRN)