##// END OF EJS Templates
py3: drop xrange
marcink -
r982:9917a6cc python3
parent child Browse files
Show More
@@ -41,7 +41,7 b' class EchoAppStream(object):'
41 start_response(status, headers)
41 start_response(status, headers)
42
42
43 def generator():
43 def generator():
44 for _ in xrange(1000000):
44 for _ in range(1000000):
45 yield "ECHO"
45 yield "ECHO"
46 return generator()
46 return generator()
47
47
@@ -703,7 +703,7 b' class HgRemote(RemoteBase):'
703 return len(repo) - 1, 0
703 return len(repo) - 1, 0
704
704
705 stop, start = get_revs(repo, [node + ':'])
705 stop, start = get_revs(repo, [node + ':'])
706 revs = [hex(repo[r].node()) for r in xrange(start, stop + 1)]
706 revs = [hex(repo[r].node()) for r in range(start, stop + 1)]
707 return revs
707 return revs
708
708
709 @reraise_safe_exceptions
709 @reraise_safe_exceptions
@@ -219,7 +219,7 b' def _check_heads(repo, start, end, commi'
219 # The heads descending from that parent, on the same branch
219 # The heads descending from that parent, on the same branch
220 parent_heads = set([p])
220 parent_heads = set([p])
221 reachable = set([p])
221 reachable = set([p])
222 for x in xrange(p + 1, end):
222 for x in range(p + 1, end):
223 if get_ctx(repo, x).branch() != branch:
223 if get_ctx(repo, x).branch() != branch:
224 continue
224 continue
225 for pp in changelog.parentrevs(x):
225 for pp in changelog.parentrevs(x):
@@ -212,7 +212,7 b' class GitRepository(object):'
212 return
212 return
213
213
214 chunker = (
214 chunker = (
215 data[i:i + chunk_size] for i in xrange(0, len(data), chunk_size))
215 data[i:i + chunk_size] for i in range(0, len(data), chunk_size))
216
216
217 for chunk in chunker:
217 for chunk in chunker:
218 proto.write_sideband(2, chunk)
218 proto.write_sideband(2, chunk)
@@ -27,13 +27,13 b' def data():'
27
27
28 def test_http_app_streaming_with_data(data, repeat, vcs_app):
28 def test_http_app_streaming_with_data(data, repeat, vcs_app):
29 app = vcs_app
29 app = vcs_app
30 for x in xrange(repeat / 10):
30 for x in range(repeat / 10):
31 response = app.post('/stream/git/', params=data)
31 response = app.post('/stream/git/', params=data)
32 assert response.status_code == 200
32 assert response.status_code == 200
33
33
34
34
35 def test_http_app_streaming_no_data(repeat, vcs_app):
35 def test_http_app_streaming_no_data(repeat, vcs_app):
36 app = vcs_app
36 app = vcs_app
37 for x in xrange(repeat / 10):
37 for x in range(repeat / 10):
38 response = app.post('/stream/git/')
38 response = app.post('/stream/git/')
39 assert response.status_code == 200
39 assert response.status_code == 200
@@ -32,7 +32,7 b' class KindaFilelike(object): # pragma: '
32 self.stream = self._get_stream(data, chunks)
32 self.stream = self._get_stream(data, chunks)
33
33
34 def _get_stream(self, data, chunks):
34 def _get_stream(self, data, chunks):
35 for x in xrange(chunks):
35 for x in range(chunks):
36 yield data
36 yield data
37
37
38 def read(self, n):
38 def read(self, n):
General Comments 0
You need to be logged in to leave comments. Login now