Skip to content

Commit

Permalink
Try using six to check for string type
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Nov 25, 2018
1 parent 29189b0 commit f6c61b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions epregressions/diffs/mycsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# along with mathdiff. If not, see <http://www.gnu.org/licenses/>.

import csv
import six

from io import StringIO

Expand Down Expand Up @@ -85,12 +86,12 @@ def ismatrice(mat):
for row in mat:
if type(row) != list:
return False
# test if cell is float,int or string
# test if cell is float, int or string
for row in mat:
for cell in row:
if type(cell) not in (float, int, str):
print("DKLDLFKJSDLFKJSDFLKJ TYPE: " + str(type(cell)))
return False
if type(cell) not in (float, int):
if not isinstance(cell, six.string_types):
return False
return True


Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ coveralls==1.5.1
beautifulsoup4==4.6.3
flake8==3.6.0
nose==1.3.7
six
Sphinx==1.8.1

# this GUI uses PyGtk, relying on GTK3+
Expand Down

0 comments on commit f6c61b3

Please sign in to comment.