diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-01-25 11:46:30 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-02-23 23:34:05 +0000 |
commit | 2bad848b85f3463edca652e0f73cc64c57961fbb (patch) | |
tree | c443197788098e575e94530745dec93267192e80 /src/python/m5/__init__.py | |
parent | f59e550bc8164a2a8d06bf18099f993c7181367c (diff) | |
download | gem5-2bad848b85f3463edca652e0f73cc64c57961fbb.tar.xz |
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>
Diffstat (limited to 'src/python/m5/__init__.py')
-rw-r--r-- | src/python/m5/__init__.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/python/m5/__init__.py b/src/python/m5/__init__.py index 2730ea142..d97727cd8 100644 --- a/src/python/m5/__init__.py +++ b/src/python/m5/__init__.py @@ -26,6 +26,9 @@ # # Authors: Nathan Binkert +from __future__ import print_function +from __future__ import absolute_import + # Import useful subpackages of M5, but *only* when run as an m5 # script. This is mostly to keep backward compatibility with existing # scripts while allowing new SCons code to operate properly. @@ -42,14 +45,14 @@ except ImportError: in_gem5 = False if in_gem5: - import SimObject - import core - import objects - import params - import stats - import util + from . import SimObject + from . import core + from . import objects + from . import params + from . import stats + from . import util - from event import * - from main import main - from simulate import * + from .event import * + from .main import main + from .simulate import * |