Commit ce91799b authored by Javier Quinteros's avatar Javier Quinteros

Bugfix: Check value of __chstop before using it

parent 78f50df4
......@@ -49,7 +49,6 @@ class TDMS(object):
return self
# TODO Add parameter to accept a list with channel numbers
def __init__(self, filename, directory='.', chstart=0, chstop=None, chstep=1, channels=None,
starttime=None, endtime=None, iterate='D', decimate=1, firfilter='fir235',
......@@ -429,7 +428,7 @@ class TDMS(object):
if self.__channels is None:
if self.__chstart >= numchannels:
raise Exception('No valid channel IDs selected!')
if self.__chstop >= numchannels:
if self.__chstop is None or self.__chstop >= numchannels:
logs.warning('Resetting chstop from %s to %s' % (self.__chstop, numchannels-1))
self.__chstop = numchannels - 1
# Define list of selected channels
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment