Skip to content

Commit

Permalink
More robust type introspection and error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
standage committed Sep 15, 2017
1 parent ed7556f commit f0f61cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion khmer/_oxli/graphs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,11 @@ cdef class Hashtable:
_parser = (<FastxParser>parser_or_filename)._this
elif isinstance(parser_or_filename, ReadParser):
_parser = (<CPyReadParser_Object*>parser_or_filename).parser
else:
elif is_str(parser_or_filename):
_parser = get_parser[CpFastxReader](_bstring(parser_or_filename))
else:
raise TypeError('argument does not appear to be a parser or a '
'filename: {}'.format(parser_or_filename))
return _parser


Expand Down

0 comments on commit f0f61cd

Please sign in to comment.