diff options
author | Georg Brandl <georg@python.org> | 2007-04-21 15:47:16 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-04-21 15:47:16 (GMT) |
commit | a18af4e7a2091d11478754eb66ae387a85535763 (patch) | |
tree | fea8015d656cfee937bb6f3d106e6ca0e9f19d78 /Lib/test/test_file.py | |
parent | 4d2adcca52ced412d4bdf131b872729c43520d58 (diff) | |
download | cpython-a18af4e7a2091d11478754eb66ae387a85535763.zip cpython-a18af4e7a2091d11478754eb66ae387a85535763.tar.gz cpython-a18af4e7a2091d11478754eb66ae387a85535763.tar.bz2 |
PEP 3114: rename .next() to .__next__() and add next() builtin.
Diffstat (limited to 'Lib/test/test_file.py')
-rw-r--r-- | Lib/test/test_file.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index c4bd610..f682f89 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() |