mem: Fix python3 incompatibility issue in slicc's HTML builder
authorHoa Nguyen <hoanguyen@ucdavis.edu>
Wed, 1 Jul 2020 02:07:35 +0000 (19:07 -0700)
committerHoa Nguyen <hoanguyen@ucdavis.edu>
Wed, 1 Jul 2020 06:41:09 +0000 (06:41 +0000)
In python3, an iterator does not have the next() method.
next(iterator) works in both python2.7+ and python3.

Change-Id: Ic1ceb993018a0f37e8d30086a054ffc2e311bb46
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30874
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/slicc/generate/html.py

index ecb4baa75a89fc2d0843c3a0c236b3a970f0cfe8..c0ed368e77f6cfbd236539b347b33cbc4e833cbf 100644 (file)
@@ -62,7 +62,7 @@ def formatShorthand(short):
             if i + 1 < len(short):
                 # -- Proceed to next char. Yes I know that changing
                 # the loop var is ugly!
-                i,c = gen.next()
+                i,c = next(gen)
                 munged_shorthand += "<B><FONT size=+1>"
                 munged_shorthand += c
                 munged_shorthand += "</FONT></B>"