Commit 85cee658 authored by Romain Feron's avatar Romain Feron
Browse files

Quick fix to read positions file: empty lines are ignored

parent 2cb2085b
......@@ -6,11 +6,12 @@ def load_positions_list(positions_file_path, global_parameters):
with open(positions_file_path) as positions_file:
for line in positions_file:
try:
fields = line[:-1].split('\t')
positions.append(tuple([int(fields[0]), int(fields[1])]))
except IndexError:
print('Error: cannot read positions file')
exit(1)
if line[:-1]:
try:
fields = line[:-1].split('\t')
positions.append(tuple([int(fields[0]), int(fields[1])]))
except IndexError:
print('Error: cannot read positions file')
exit(1)
global_parameters.positions_list = positions
Supports Markdown
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