super(FileWrapper, self).__init__(file_name, 'r')
self._line_no = 0
- def next(self):
+ def __next__(self):
"""
Python 2 iterator method. This method overrides base class's
next method and extends the next method to count the line
if hasattr(parent, '__next__'):
line = parent.__next__() # Python 3
else:
- line = parent.next() # Python 2 # pylint: disable=no-member
+ line = next(parent) # Python 2 # pylint: disable=no-member
if line is not None:
self._line_no += 1
# Convert byte array to string with correct encoding and