Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3c668c1

Browse files
committed
Add next and __iter__ to the list of file methods that should raise
ValueError when called for a closed file.
1 parent 7a6e959 commit 3c668c1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/test_file.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ class NonString: pass
8989
if not f.closed:
9090
raise TestFailed, 'file.closed should be true'
9191

92-
methods = ['fileno', 'flush', 'isatty', 'read', 'readinto', 'readline', 'readlines', 'seek', 'tell', 'truncate', 'write', 'xreadlines' ]
92+
methods = ['fileno', 'flush', 'isatty', 'next', 'read', 'readinto',
93+
'readline', 'readlines', 'seek', 'tell', 'truncate', 'write',
94+
'xreadlines', '__iter__']
9395
if sys.platform.startswith('atheos'):
9496
methods.remove('truncate')
9597

0 commit comments

Comments
 (0)