# pylint: disable=wrong-import-order
try:
# Python 2
- from StringIO import StringIO
+ from io import StringIO
except ImportError:
# Python 3
from io import StringIO
self.line_no = line_no
self.name = file_name
- def next(self):
+ def __next__(self):
"""
Iterator method. This method overrides base class's
next method and extends the next method to count the line
parent = super(StringIOWrapper, self)
if getattr(parent, 'next', None):
# Python 2
- line = parent.next()
+ line = next(parent)
else:
# Python 3
line = parent.__next__()