]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - TLD_Builder/util.py
- substitute cmp for python3
[tld-builder.git] / TLD_Builder / util.py
index 1d485a170c20378fab39a6ad092f1fd04a5dc1ee..602bad176fe9e4ba01c6d7f4344bd235dc0c2ae2 100644 (file)
@@ -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)