Skip to content

Commit

Permalink
changed error check and type
Browse files Browse the repository at this point in the history
  • Loading branch information
JayHuLBL committed Apr 12, 2024
1 parent 64cda69 commit 27d7fd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyfunnel/pyfunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
data[s] = dict(x=[], y=[])
with open(vars(args)[s]) as csvfile:
spamreader = csv.reader(csvfile)
if (len(next(spamreader)) != 2):
raise RuntimeError("The {} CSV file must have exactly two columns.".format(s))
if (len(spamreader[0]) != 2):
raise IOError("The {} CSV file must have exactly two columns.".format(s))
for row in spamreader:
try:
data[s]['x'].append(float(row[0]))
Expand Down

0 comments on commit 27d7fd1

Please sign in to comment.