python: Remove Python 2.7 compatibility code

We don't support Python 2.7 anymore. Remove glue code like the six
dependency and "from __future__" imports from gem5's standard library.

Change-Id: I71834c325f86ff0329b222be87794ead96081f05
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39584
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Andreas Sandberg
2021-01-21 17:09:38 +00:00
parent 36ab8ef4e7
commit 4b9c46caa5
28 changed files with 32 additions and 133 deletions

View File

@@ -24,9 +24,6 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from __future__ import print_function
from six import add_metaclass
try:
import builtins
except ImportError:
@@ -112,8 +109,7 @@ class code_formatter_meta(type):
}
cls.pattern = re.compile(pat, re.VERBOSE | re.DOTALL | re.MULTILINE)
@add_metaclass(code_formatter_meta)
class code_formatter(object):
class code_formatter(object, metaclass=code_formatter_meta):
delim = r'$'
ident = r'[_A-z]\w*'
pos = r'[0-9]+'