[Fuego] [PATCH 6/8] Replace cmp() function with equivalent expression

[email protected] Wed, 20 Apr 2022 15:41:38 +0530
Newsgroups dev.linux.lists.fuego
Message-ID <[email protected]>
From: Shivanand Kunijadar <[email protected]>

The function cmp() is not supported in python3. Replace cmp() function
with equivalent expression and the expression works well in python2 and 3

Signed-off-by: Shivanand Kunijadar <[email protected]>
---
 scripts/parser/common.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/parser/common.py b/scripts/parser/common.py
index d7dcfbd..a04047a 100644
--- a/scripts/parser/common.py
+++ b/scripts/parser/common.py
@@ -547,7 +547,7 @@ def name_compare(a, b):
         b_name = b["name"]
     except:
         b_name = b
-    return cmp(a_name, b_name)
+    return (a_name > b_name) - (a_name < b_name)
 
 def dump_ordered_data(data, indent=""):
     if type(data)==type({}):
-- 
2.20.1