X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fbup%2Fclient.py;h=cad6e28b75145c338ab5102f0a1f4800a3ab1c18;hb=d4100c81448484b8ea222fb78757bf003e181cf1;hp=8c364d19b401ddfa5368716f7c3d722f7c0a0bed;hpb=aeafe13a9330e7deca3dc6b9c0496937d904663a;p=bup.git diff --git a/lib/bup/client.py b/lib/bup/client.py index 8c364d1..cad6e28 100644 --- a/lib/bup/client.py +++ b/lib/bup/client.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import errno, os, re, struct, sys, time, zlib from bup import git, ssh +from bup.compat import range from bup.helpers import (Conn, atomically_replaced_file, chunkyreader, debug1, debug2, linereader, lines_until_sentinel, mkdirp, progress, qprogress) @@ -27,7 +28,7 @@ def _raw_write_bwlimit(f, buf, bwcount, bwtime): # the average back up to bwlimit - that will risk overflowing the # outbound queue, which defeats the purpose. So if we fall behind # by more than one block delay, we shouldn't ever try to catch up. - for i in xrange(0,len(buf),4096): + for i in range(0,len(buf),4096): now = time.time() next = max(now, bwtime + 1.0*bwcount/bwlimit) time.sleep(next-now) @@ -414,7 +415,7 @@ class Client: conn.write('\n') conn.write('\n') if not format: - for _ in xrange(len(refs)): + for _ in range(len(refs)): line = conn.readline() if not line: raise ClientError('unexpected EOF') @@ -422,7 +423,7 @@ class Client: assert len(line) == 40 yield line else: - for _ in xrange(len(refs)): + for _ in range(len(refs)): line = conn.readline() if not line: raise ClientError('unexpected EOF')