From b8c455500a08c75c4809e523d348027e72cda7ec Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Thu, 14 Sep 2017 14:34:44 -0700 Subject: 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 Reviewed-by: Stephen Warren --- test/py/u_boot_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/py/u_boot_utils.py') diff --git a/test/py/u_boot_utils.py b/test/py/u_boot_utils.py index bb31e57b27..d68d1dd105 100644 --- a/test/py/u_boot_utils.py +++ b/test/py/u_boot_utils.py @@ -120,7 +120,7 @@ def wait_until_open_succeeds(fn): An open file handle to the file. """ - for i in xrange(100): + for i in range(100): fh = attempt_to_open_file(fn) if fh: return fh @@ -143,7 +143,7 @@ def wait_until_file_open_fails(fn, ignore_errors): Nothing. """ - for i in xrange(100): + for i in range(100): fh = attempt_to_open_file(fn) if not fh: return -- cgit v1.2.3