Replace isinstance(foo, str) for py3 support

Issue #750 resolved
Martin Sandve Alnæs created an issue

Replace isinstance(foo, str) with isinstance(foo, string_types), given from six import string_types.

There are 72 occurances across all fenics components according to this grep:

grep 'isinstance(.*,[ ]*str)' `find -name \*.py` | grep -v build | wc

Comments (7)

  1. Martin Sandve Alnæs reporter

    Real programmers use sed.

    sed -i 's/isinstance(\(.*\),[ ]*str)/isinstance(\1, string_types)/g' `find -name \*.py`
    
  2. Martin Sandve Alnæs reporter

    Fixes in dijitso, ufl, ffc, fiat, dolfin (no needed in instant) are in master and/or next branches.

  3. Log in to comment