From b03d759e1c100ec617fd107087a4a6d3de315b74 Mon Sep 17 00:00:00 2001 From: Sun Austin Date: Tue, 18 Dec 2018 13:10:58 +0800 Subject: [PATCH] Fix: "map" issue for Python 2/3 compatible code Replace map(func, data) with [func(item) for item in data] Story: 2002909 Task: 24563 Change-Id: I83004eeba036908da483b247093818a6ac3f19c1 Signed-off-by: Sun Austin --- tools/engtools/hostdata-collectors/scripts/buddyinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/engtools/hostdata-collectors/scripts/buddyinfo.py b/tools/engtools/hostdata-collectors/scripts/buddyinfo.py index 2737fe40..b20435d6 100644 --- a/tools/engtools/hostdata-collectors/scripts/buddyinfo.py +++ b/tools/engtools/hostdata-collectors/scripts/buddyinfo.py @@ -57,7 +57,7 @@ class BuddyInfo(object): for line in map(self.parse_line, buddyinfo): numa_node = int(line["numa_node"]) zone = line["zone"] - free_fragments = map(int, line["nr_free"].split()) + free_fragments = [int(nr) for nr in line["nr_free"].split()] max_order = len(free_fragments) fragment_sizes = self.get_order_sizes(max_order) usage_in_bytes = [block[0] * block[1] for block in zip(free_fragments, fragment_sizes)]