diff --git a/source/c04/p01_manually_consuming_iterator.rst b/source/c04/p01_manually_consuming_iterator.rst index 35e1904..190b5e5 100644 --- a/source/c04/p01_manually_consuming_iterator.rst +++ b/source/c04/p01_manually_consuming_iterator.rst @@ -32,7 +32,7 @@ with open('/etc/passwd') as f: while True: - line = next(f) + line = next(f, None) if line is None: break print(line, end='')