aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Preud'homme <thomasp@graphcore.ai>2019-09-23 07:45:28 +0000
committerThomas Preud'homme <thomasp@graphcore.ai>2019-09-23 07:45:28 +0000
commit48a9a33fe39a14a80a9b1de29b7f6fed8b692caa (patch)
tree8aad6eda50514724f53e5407cfa26d3cba6a1420
parent3dc2ee9e9c51bf9520090367c2e22ace3a1c0e77 (diff)
[LNT] Python 3 support: Get next element with next builtin
Use next() builtin rather than the .next() method to retrieve the next element of an iterator since the latter does not exist in Python 3. next() builtin was introduced in Python 2.6. This was produced by running futurize's stage1 libfuturize.fixes.fix_next_call. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67812 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372552 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lnt/testing/profile/profilev2impl.py2
-rw-r--r--lnt/tests/nt.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/lnt/testing/profile/profilev2impl.py b/lnt/testing/profile/profilev2impl.py
index c0114ba..2a0020d 100644
--- a/lnt/testing/profile/profilev2impl.py
+++ b/lnt/testing/profile/profilev2impl.py
@@ -541,7 +541,7 @@ class Functions(Section):
address_gen = self.line_addresses.extractForFunction(fname)
text_gen = self.line_text.extractForFunction(fname)
for n in xrange(f['length']):
- yield (counter_gen.next(), address_gen.next(), text_gen.next())
+ yield (next(counter_gen), next(address_gen), next(text_gen))
def copy(self, counter_name_pool, line_counters,
line_addresses, line_text):
diff --git a/lnt/tests/nt.py b/lnt/tests/nt.py
index 6fd534c..68c44bb 100644
--- a/lnt/tests/nt.py
+++ b/lnt/tests/nt.py
@@ -773,7 +773,7 @@ def load_nt_report_file(report_path, config):
reader_it = iter(csv.reader(report_file))
# Get the header.
- header = reader_it.next()
+ header = next(reader_it)
if header[0] != 'Program':
fatal('unexpected report file, missing header')