#
# Authors: Giacomo Travaglini
+from six import string_types
+
from m5.SimObject import *
from m5.params import *
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:
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:
# 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
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)):
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import os
+from six import string_types
import ply.lex
import ply.yacc
"'%s' object has no attribute '%s'" % (type(self), attr))
def parse_string(self, data, source='<string>', debug=None, tracking=0):
- if not isinstance(data, basestring):
+ if not isinstance(data, string_types):
raise AttributeError(
"argument must be a string, was '%s'" % type(f))
return result
def parse_file(self, f, **kwargs):
- if isinstance(f, basestring):
+ if isinstance(f, string_types):
source = f
f = open(f, 'r')
elif isinstance(f, file):