test/py: Use range() rather than xrange()

In python 3.x the xrange() function has been removed, and range()
returns an iterator much like Python 2.x's xrange(). Simply use range()
in place of xrange() in order to work on both python 2.x & 3.x. This
will mean a small cost on python 2.x since range() will return a list
there rather than an iterator, but the cost should be negligible.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
Paul Burton 2017-09-14 14:34:44 -07:00 committed by Simon Glass
parent dffd56d1d2
commit b8c455500a
3 changed files with 6 additions and 6 deletions

View file

@ -81,7 +81,7 @@ class ConsoleSandbox(ConsoleBase):
p = self.p
self.p = None
for i in xrange(100):
for i in range(100):
ret = not p.isalive()
if ret:
break