From 3f7df29dd695aee3057db8d0287fbc2758ace82d Mon Sep 17 00:00:00 2001 From: MRXLT Date: Tue, 7 Apr 2020 05:37:24 +0000 Subject: [PATCH] fix show_profile for py3 --- python/examples/util/show_profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/examples/util/show_profile.py b/python/examples/util/show_profile.py index c3e8adc0..9153d939 100644 --- a/python/examples/util/show_profile.py +++ b/python/examples/util/show_profile.py @@ -10,7 +10,7 @@ time_dict = collections.OrderedDict() def prase(line): profile_list = line.split(" ") num = len(profile_list) - for idx in range(num / 2): + for idx in range(int(num / 2)): profile_0_list = profile_list[idx * 2].split(":") profile_1_list = profile_list[idx * 2 + 1].split(":") if len(profile_0_list[0].split("_")) == 2: @@ -18,7 +18,7 @@ def prase(line): else: name = profile_0_list[0].split("_")[0] + "_" + profile_0_list[ 0].split("_")[1] - cost = long(profile_1_list[1]) - long(profile_0_list[1]) + cost = int(profile_1_list[1]) - int(profile_0_list[1]) if name not in time_dict: time_dict[name] = cost else: -- GitLab