diff --git a/Lib/StringIO.py b/Lib/StringIO.py index 2aef3c329e1..cb7313d42a9 100644 --- a/Lib/StringIO.py +++ b/Lib/StringIO.py @@ -45,6 +45,9 @@ class StringIO: self.closed = 0 self.softspace = 0 + def __iter__(self): + return iter(self.readline, '') + def close(self): if not self.closed: self.closed = 1