diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-01-26 14:08:20 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-02-25 14:25:24 +0000 |
commit | a347a1a68b8a6e370334be3a1d2d66675891e0f1 (patch) | |
tree | 36a2ace396538bae15a1652328cfec6b93462fc5 /src/mem | |
parent | b5b19d247024022a93df320158a2aea2a772e54f (diff) | |
download | gem5-a347a1a68b8a6e370334be3a1d2d66675891e0f1.tar.xz |
python: Stop using basestring to test for strings
The base class basestring doesn't exist in Python 3. Use string_types
from six instead.
Change-Id: I7e84903fb7dd4a0af7ae4e9f4ec2e54338f212bb
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15998
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Juha Jäykkä <juha.jaykka@arm.com>
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/qos/QoSPolicy.py | 6 | ||||
-rw-r--r-- | src/mem/slicc/util.py | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/mem/qos/QoSPolicy.py b/src/mem/qos/QoSPolicy.py index 6db04aca1..be18cd64a 100644 --- a/src/mem/qos/QoSPolicy.py +++ b/src/mem/qos/QoSPolicy.py @@ -35,6 +35,8 @@ # # Authors: Giacomo Travaglini +from six import string_types + from m5.SimObject import * from m5.params import * @@ -71,7 +73,7 @@ class QoSFixedPriorityPolicy(QoSPolicy): for mprio in self._mpriorities: master = mprio[0] priority = mprio[1] - if isinstance(master, basestring): + if isinstance(master, string_types): self.getCCObject().initMasterName( master, int(priority)) else: @@ -108,7 +110,7 @@ class QoSPropFairPolicy(QoSPolicy): for mprio in self._mscores: master = mprio[0] score = mprio[1] - if isinstance(master, basestring): + if isinstance(master, string_types): self.getCCObject().initMasterName( master, float(score)) else: diff --git a/src/mem/slicc/util.py b/src/mem/slicc/util.py index 3a0cf5f35..dcb780d6b 100644 --- a/src/mem/slicc/util.py +++ b/src/mem/slicc/util.py @@ -25,6 +25,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from __future__ import print_function +from six import string_types import os import sys @@ -49,7 +50,7 @@ class PairContainer(object): class Location(object): def __init__(self, filename, lineno, no_warning=False): - if not isinstance(filename, basestring): + if not isinstance(filename, string_types): raise AttributeError, \ "filename must be a string, found '%s'" % (type(filename), ) if not isinstance(lineno, (int, long)): |