Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
replace remaining basestring by six.string_types
Browse files Browse the repository at this point in the history
  • Loading branch information
a-andre committed Jun 9, 2015
1 parent eaa8dc7 commit b16df45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/sage/quivers/algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

import six
from sage.misc.cachefunc import cached_method
from sage.combinat.free_module import CombinatorialFreeModule, CombinatorialFreeModuleElement

Expand Down Expand Up @@ -274,7 +275,7 @@ def _element_constructor_(self, x):

# If it's a tuple or a list try and create a QuiverPath from it and
# then return the associated basis element
if isinstance(x, (tuple, list, basestring)):
if isinstance(x, (tuple, list, six.string_types)):
return self.monomial(self._semigroup(x))

# Otherwise let CombinatorialFreeModule try
Expand Down
5 changes: 3 additions & 2 deletions src/sage/quivers/path_semigroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

import six
from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.structure.parent import Parent
Expand Down Expand Up @@ -337,15 +338,15 @@ def _element_constructor_(self, data, check=True):
elif data == 1:
start = end = self._quiver.vertex_iterator().next()
path = []
elif isinstance(data, basestring): # one edge
elif isinstance(data, six.string_types): # one edge
i = L.get(data, None)
if i is None:
raise ValueError("data={!r} is not the label of an edge".format(data))
start,end,_ = E[i]
path = [i]
elif not isinstance(data, (tuple,list)):
raise TypeError("data={} is not valid. A path must be initialized from either a tuple or a list".format(data))
elif isinstance(data[0], basestring): # a list of labels
elif isinstance(data[0], six.string_types): # a list of labels
start = L.get(data[0])
if start is None:
raise ValueError("data[0]={!r} is not the label of an edge".format(data[0]))
Expand Down

0 comments on commit b16df45

Please sign in to comment.