python: Enforce absolute imports for Python 3 compatibility

Change-Id: Ia88d7fd472f7aed9b97df81468211384981bf6c6
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15983
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Andreas Sandberg
2019-01-25 11:46:30 +00:00
parent f59e550bc8
commit 2bad848b85
23 changed files with 84 additions and 42 deletions

View File

@@ -45,14 +45,14 @@ import os
import re
import sys
import convert
import jobfile
from . import convert
from . import jobfile
from attrdict import attrdict, multiattrdict, optiondict
from code_formatter import code_formatter
from multidict import multidict
from smartdict import SmartDict
from sorteddict import SortedDict
from .attrdict import attrdict, multiattrdict, optiondict
from .code_formatter import code_formatter
from .multidict import multidict
from .smartdict import SmartDict
from .sorteddict import SortedDict
# panic() should be called when something happens that should never
# ever happen regardless of what the user does (i.e., an acutal m5

View File

@@ -279,7 +279,7 @@ class code_formatter(object):
__all__ = [ "code_formatter" ]
if __name__ == '__main__':
from code_formatter import code_formatter
from .code_formatter import code_formatter
f = code_formatter()
class Foo(dict):

View File

@@ -57,6 +57,9 @@
#
#####################################################################
from __future__ import print_function
from __future__ import absolute_import
import m5, os, re
from m5.SimObject import isRoot, isSimObjectVector
from m5.params import PortRef, isNullPointer

View File

@@ -27,6 +27,7 @@
# Authors: Nathan Binkert
from __future__ import print_function
from __future__ import absolute_import
import sys

View File

@@ -35,6 +35,9 @@
#
# Authors: Andreas Sandberg
from __future__ import print_function
from __future__ import absolute_import
from abc import *
class PyBindExport(object):

View File

@@ -41,9 +41,11 @@
# rather than a normal value, and (c) coerce values written to the
# dict to be strings.
from __future__ import print_function
from __future__ import absolute_import
from convert import *
from attrdict import attrdict
from .convert import *
from .attrdict import attrdict
class Variable(str):
"""Intelligent proxy class for SmartDict. Variable will use the

View File

@@ -25,6 +25,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from __future__ import print_function
from __future__ import absolute_import
from bisect import bisect_left, bisect_right

View File

@@ -27,6 +27,7 @@
# Author: Steve Reinhardt
from __future__ import print_function
from __future__ import absolute_import
import sys