Ignore:
Timestamp:
Mar 4, 2011, 2:34:28 PM (13 years ago)
Author:
wilsonr
Message:

Changes to address ticket 360.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py

    r8124 r8125  
    1313"""
    1414
    15 import types
    1615from time import time as walltime
    1716
     
    9089       
    9190        # Determine whether source is a mesh filename or coordinates
    92         if type(source) == types.StringType:
     91        if isinstance(source, basestring):
    9392            mesh_filename = source
    9493        else:
     
    861860    def _set_region(self, functions):
    862861        # coerce to an iterable (list or tuple)
    863         if type(functions) not in [types.ListType, types.TupleType]:
     862        if not isinstance(functions, (list, tuple)):
    864863            functions = [functions]
    865864
     
    11601159        if quantities is None:
    11611160            quantities = self.evolved_quantities
    1162         elif type(quantities) == types.StringType:
     1161        elif isinstance(quantities, basestring):
    11631162            quantities = [quantities] #Turn it into a list
    11641163
    11651164        msg = ('Keyword argument quantities must be either None, '
    11661165               'string or list. I got %s') % str(quantities)
    1167         assert type(quantities) == types.ListType, msg
     1166        assert isinstance(quantities, list), msg
    11681167
    11691168        if tags is None:
    11701169            tags = self.get_boundary_tags()
    1171         elif type(tags) == types.StringType:
     1170        elif isinstance(tags, basestring):
    11721171            tags = [tags] #Turn it into a list
    11731172
    11741173        msg = ('Keyword argument tags must be either None, '
    11751174               'string or list. I got %s') % str(tags)
    1176         assert type(tags) == types.ListType, msg
     1175        assert isinstance(tags, list), msg
    11771176
    11781177        # Determine width of longest quantity name (for cosmetic purposes)
Note: See TracChangeset for help on using the changeset viewer.