From 3c668c1256fb1ae3233af3f906891c4d8625c717 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 6 Aug 2002 15:58:24 +0000 Subject: [PATCH] Add next and __iter__ to the list of file methods that should raise ValueError when called for a closed file. --- Lib/test/test_file.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index 1eb84185f42..be1b2de88e9 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -89,7 +89,9 @@ class NonString: pass if not f.closed: raise TestFailed, 'file.closed should be true' -methods = ['fileno', 'flush', 'isatty', 'read', 'readinto', 'readline', 'readlines', 'seek', 'tell', 'truncate', 'write', 'xreadlines' ] +methods = ['fileno', 'flush', 'isatty', 'next', 'read', 'readinto', + 'readline', 'readlines', 'seek', 'tell', 'truncate', 'write', + 'xreadlines', '__iter__'] if sys.platform.startswith('atheos'): methods.remove('truncate')