repopick: cmp() is not available in Python 3, define it manually
Change-Id: I16a89aa555e62f105d888e87cb43afd26606076b
This commit is contained in:
committed by
Christopher H.
parent
337f13e448
commit
5ee35ea356
@@ -48,6 +48,12 @@ except ImportError:
|
|||||||
urllib.request = urllib2
|
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
|
# Verifies whether pathA is a subdirectory (or the same) as pathB
|
||||||
def is_subdir(a, b):
|
def is_subdir(a, b):
|
||||||
a = os.path.realpath(a) + '/'
|
a = os.path.realpath(a) + '/'
|
||||||
|
Reference in New Issue
Block a user