X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=TLD_Builder%2Futil.py;h=602bad176fe9e4ba01c6d7f4344bd235dc0c2ae2;hb=90e89153ad56b37c24ba84ec1ade4dd4984a4059;hp=1d485a170c20378fab39a6ad092f1fd04a5dc1ee;hpb=9ea122b00e3a99b16246e1e38576916a2e25c0aa;p=tld-builder.git diff --git a/TLD_Builder/util.py b/TLD_Builder/util.py index 1d485a1..602bad1 100644 --- a/TLD_Builder/util.py +++ b/TLD_Builder/util.py @@ -36,7 +36,7 @@ def sendfile(src, dst): cnt = 0 while 1: s = src.read(10000) - if s == "": break + if s == "" or s == b"": break cnt += len(s) dst.write(s) return cnt @@ -112,3 +112,6 @@ def to_str(s): return s else: raise TypeError("Expected bytes or string, but got %s." % type(s)) + +def cmp(a, b): + return (a > b) - (a < b)