Fix empty datatypes.

This commit is contained in:
John Chilton
2018-06-29 15:54:39 -07:00
parent 0ea09e4dd6
commit 29f8e29b0b
3 changed files with 7 additions and 2 deletions
+4 -2
View File
@@ -393,8 +393,10 @@ class Ms2(Text):
header_lines = []
while True:
line = contents.readline()
if line is None or len(line) == 0:
pass
if not line:
return False
if line.strip() == "":
continue
elif line.startswith('H\t'):
header_lines.append(line)
else:
+3
View File
@@ -290,6 +290,9 @@ def guess_ext(fname, sniff_order, is_binary=False):
>>> from galaxy.datatypes.registry import example_datatype_registry_for_sample
>>> datatypes_registry = example_datatype_registry_for_sample()
>>> sniff_order = datatypes_registry.sniff_order
>>> fname = get_test_fname('empty.txt')
>>> guess_ext(fname, sniff_order)
'txt'
>>> fname = get_test_fname('megablast_xml_parser_test1.blastxml')
>>> guess_ext(fname, sniff_order)
'blastxml'
View File