python: Use six's with_metaclass instead of it's add_metaclass.
authorGabe Black <gabeblack@google.com>
Mon, 24 Aug 2020 03:15:40 +0000 (20:15 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 25 Aug 2020 19:47:50 +0000 (19:47 +0000)
commit5d420afaa037e41dd0480218db28f08e65279d93
tree60aa0fbb93eecb91beabbeb3d7d2c57a770e5f77
parentcf88ba0c0963076006c2eaed1b113ae5f2a79901
python: Use six's with_metaclass instead of it's add_metaclass.

The decorator creates two versions of a class, adding it to the Params
dict multiple times which generates an annoying warning. Alternatively,
the with_metaclass mechanism sets up an alternative base class which
does not create the extra class and doesn't generate the warning.

It may be the case that this generates extra classes which just don't
lead to a warning? Or in other words, would we then have Params types
with weird, internal names generated by six? Hopefully not, but that may
be preferable to the annoying warnings, especially when running tests
which run gem5 many times.

Change-Id: I9395cde3fc95126c0a0c4db67fc5b0c6bf2dd9ed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33276
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/python/m5/params.py