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/slicc/util.py | |
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/slicc/util.py')
-rw-r--r-- | src/mem/slicc/util.py | 3 |
1 files changed, 2 insertions, 1 deletions
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)): |