repopick: cmp() is not available in Python 3, define it manually
Change-Id: I16a89aa555e62f105d888e87cb43afd26606076b
diff --git a/build/tools/repopick.py b/build/tools/repopick.py
index 7c6bf15..cf264a0 100755
--- a/build/tools/repopick.py
+++ b/build/tools/repopick.py
@@ -48,6 +48,12 @@
urllib.request = urllib2
+# cmp() is not available in Python 3, define it manually
+# See https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons
+def cmp(a, b):
+ return (a > b) - (a < b)
+
+
# Verifies whether pathA is a subdirectory (or the same) as pathB
def is_subdir(a, b):
a = os.path.realpath(a) + '/'