[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] [PATCH 04/12] Fixes xgps for Python 3.
From: |
Fred Wright |
Subject: |
[gpsd-dev] [PATCH 04/12] Fixes xgps for Python 3. |
Date: |
Fri, 8 Apr 2016 10:07:45 -0700 |
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).
---
xgps | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xgps b/xgps
index c7955b4..79fd3fb 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)
--
2.8.0
- [gpsd-dev] Python 3 Updates, Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 01/12] Fixes Python C extensions for Python 3 compatibility., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 02/12] Fixes fake.py 'packet' import for Python 3., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 04/12] Fixes xgps for Python 3.,
Fred Wright <=
- [gpsd-dev] [PATCH 05/12] Fixes a client.py exception for Python 3., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 06/12] Fixes Gtk warnings related to xgps/xgpsspeed error boxes., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 07/12] Changes type checks in misc.py:isotime to use isinstance()., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 03/12] Forces Python 3 import behavior in all gps/* modules., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 09/12] Fixes gpscat and test_maidenhead.py for Python 3., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 08/12] Removes unnecessary Unicode literal from xgps., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 10/12] Fixes fake.py and gpsfake for Python 3., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 12/12] Removes redundant polystr/polybytes defs from client.py., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 11/12] Adds "target Python" support to SConstruct., Fred Wright, 2016/04/08
- Re: [gpsd-dev] Python 3 Updates, Gary E. Miller, 2016/04/08