From 27d7fd1fa783e16ea7e8b38cb5c5e8b913443f26 Mon Sep 17 00:00:00 2001 From: JayHuLBL Date: Fri, 12 Apr 2024 12:33:45 -0700 Subject: [PATCH] changed error check and type --- pyfunnel/pyfunnel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfunnel/pyfunnel.py b/pyfunnel/pyfunnel.py index 7021b39..3b7157a 100755 --- a/pyfunnel/pyfunnel.py +++ b/pyfunnel/pyfunnel.py @@ -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]))