From fb634813509526a134b2449f32a35d3adf08d02d Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 21 Apr 2007 15:47:16 +0000 Subject: PEP 3114: rename .next() to .__next__() and add next() builtin. --- Lib/test/test_file.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Lib/test/test_file.py') diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index c4bd610d3e..f682f8950a 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -95,7 +95,7 @@ class AutoFileTests(unittest.TestCase): self.assert_(f.closed) def testMethods(self): - methods = ['fileno', 'flush', 'isatty', 'next', 'read', 'readinto', + methods = ['fileno', 'flush', 'isatty', '__next__', 'read', 'readinto', 'readline', 'readlines', 'seek', 'tell', 'truncate', 'write', '__iter__'] if sys.platform.startswith('atheos'): @@ -248,7 +248,7 @@ class OtherFileTests(unittest.TestCase): # Test for appropriate errors mixing read* and iteration for methodname, args in methods: f = open(TESTFN, 'rb') - if f.next() != filler: + if next(f) != filler: self.fail, "Broken testfile" meth = getattr(f, methodname) try: @@ -269,7 +269,7 @@ class OtherFileTests(unittest.TestCase): # between 4 and 16384 (inclusive). f = open(TESTFN, 'rb') for i in range(nchunks): - f.next() + next(f) testline = testlines.pop(0) try: line = f.readline() -- cgit v1.2.1