[Piglit] [PATCH 31/44] framework/log.py: fix next() call

baker.dylan.c at gmail.com baker.dylan.c at gmail.com
Wed Jan 27 16:06:39 PST 2016


From: Dylan Baker <baker.dylan.c at gmail.com>

In python 2 < 2.6, generators define a next() method. In python 2.6+
(including 2.7) they should define a __next__ method and are called with
the next() function.

In python 2.6 and 2.7 both are supported, but in 3.x only the __next__
method is supported

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/log.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/log.py b/framework/log.py
index cd6cdc5..213b04f 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -121,7 +121,7 @@ class QuietLog(BaseLog):
         else:
             self._endcode = '\n'
 
-        self.__counter = self._test_counter.next()
+        self.__counter = next(self._test_counter)
         self._state['running'].append(self.__counter)
 
     def start(self, name):
-- 
2.7.0



More information about the Piglit mailing list