summaryrefslogtreecommitdiffstats
path: root/tools/kvm
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2018-03-23 18:07:16 -0400
committerRadim Krčmář <rkrcmar@redhat.com>2018-03-28 22:47:06 +0200
commit6ade1ae84c9236cbb58de4b17f770f2791106676 (patch)
tree69b7b9df2d4da5c4128912964509373a5bf290ba /tools/kvm
parent8566ac8b8e7cac5814fb744ff5159d1797a1a6bd (diff)
downloadlinux-stable-6ade1ae84c9236cbb58de4b17f770f2791106676.tar.gz
linux-stable-6ade1ae84c9236cbb58de4b17f770f2791106676.tar.bz2
linux-stable-6ade1ae84c9236cbb58de4b17f770f2791106676.zip
tools/kvm_stat: Fix python3 syntax
$ python3 tools/kvm/kvm_stat/kvm_stat File "tools/kvm/kvm_stat/kvm_stat", line 1137 def sortkey((_k, v)): ^ SyntaxError: invalid syntax Fix it in a way that's compatible with python2 and python3 Signed-off-by: Cole Robinson <crobinso@redhat.com> Tested-by: Stefan Raspl <stefan.raspl@linux.vnet.ibm.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'tools/kvm')
-rwxr-xr-xtools/kvm/kvm_stat/kvm_stat6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat
index 5898c22ba310..645d4bb69f5f 100755
--- a/tools/kvm/kvm_stat/kvm_stat
+++ b/tools/kvm/kvm_stat/kvm_stat
@@ -1134,12 +1134,14 @@ class Tui(object):
def get_sorted_events(self, stats):
""" separate parent and child events """
if self._sorting == SORT_DEFAULT:
- def sortkey((_k, v)):
+ def sortkey(pair):
# sort by (delta value, overall value)
+ v = pair[1]
return (v.delta, v.value)
else:
- def sortkey((_k, v)):
+ def sortkey(pair):
# sort by overall value
+ v = pair[1]
return v.value
childs = []