Use basestring instead of str

This commit is contained in:
Sterling Harper 2016-04-27 18:13:32 -04:00
parent 37e8f455d8
commit 76b2b65ab8

View file

@ -281,7 +281,7 @@ class Material(object):
'macroscopic data-set has already been added'.format(self._id)
raise ValueError(msg)
if not isinstance(nuclide, (openmc.Nuclide, str)):
if not isinstance(nuclide, (openmc.Nuclide, basestring)):
msg = 'Unable to add a Nuclide to Material ID="{0}" with a ' \
'non-Nuclide value "{1}"'.format(self._id, nuclide)
raise ValueError(msg)
@ -401,7 +401,7 @@ class Material(object):
'macroscopic data-set has already been added'.format(self._id)
raise ValueError(msg)
if not isinstance(element, (openmc.Element, str)):
if not isinstance(element, (openmc.Element, basestring)):
msg = 'Unable to add an Element to Material ID="{0}" with a ' \
'non-Element value "{1}"'.format(self._id, element)
raise ValueError(msg)