Skip to content

Commit

Permalink
Fix mavros/param.py to work in python2 and python3, #940
Browse files Browse the repository at this point in the history
Simplify python3 fixes, #940
  • Loading branch information
fnoop authored and vooon committed Nov 29, 2018
1 parent e8f1610 commit 5e9d948
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mavros/src/mavros/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# in the top-level LICENSE file of the mavros repository.
# https://github.com/mavlink/mavros/tree/master/LICENSE.md

from future.utils import viewitems
from past.builtins import cmp

import csv
import time
import rospy
Expand Down Expand Up @@ -168,8 +165,8 @@ def param_get_all(force_pull=False):
params = rospy.get_param(mavros.get_topic('param'))

return (ret.param_received,
sorted((Parameter(k, v) for k, v in viewitems(params)),
key=functools.cmp_to_key(lambda x, y: cmp(x.param_id, y.param_id)))
sorted((Parameter(k, v) for k, v in params.items()),
key=lambda p: p.param_id)
)


Expand Down

0 comments on commit 5e9d948

Please sign in to comment.