Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Commit

Permalink
Use isinstance(foo, string_types).
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Sandve Alnæs committed Oct 5, 2016
1 parent bc8ca08 commit 43a1254
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion FIAT/reference_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from math import factorial

from six import iteritems, itervalues
from six import string_types
from six.moves import reduce
import numpy
from numpy import ravel_multi_index, transpose
Expand Down Expand Up @@ -905,7 +906,7 @@ def ufc_cell(cell):
"""Handle incoming calls from FFC."""

# celltype could be a string or a cell.
if isinstance(cell, str):
if isinstance(cell, string_types):
celltype = cell
else:
celltype = cell.cellname()
Expand Down
3 changes: 2 additions & 1 deletion FIAT/restricted.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import numpy
import six
from six import string_types
from six import iteritems
from FIAT.dual_set import DualSet
from FIAT.finite_element import FiniteElement
Expand All @@ -38,7 +39,7 @@ def __init__(self, element, indices=None, restriction_domain=None):
if not indices:
indices = _get_indices(element, restriction_domain)

if isinstance(indices, str):
if isinstance(indices, string_types):
raise RuntimeError("variable 'indices' was a string; did you forget to use a keyword?")

if len(indices) == 0:
Expand Down

0 comments on commit 43a1254

Please sign in to comment.