Fix build error with scons-4.4.0 version which is based on python3
[platform/upstream/iotivity.git] / extlibs / mbedtls / mbedtls / tests / scripts / generate_test_code.py
index 1fff099..f5e81a0 100755 (executable)
@@ -223,7 +223,7 @@ class FileWrapper(io.FileIO, object):
         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
@@ -238,7 +238,7 @@ class FileWrapper(io.FileIO, object):
         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