I'm happy to make a PR that addresses this if you like.
In [15]: pyfaidx.Sequence(seq="").complement
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-15-1fe22f7ee483> in <module>()
----> 1 pyfaidx.Sequence(seq="").complement
/Users/tim/venvs/analysis-venv-2.7/lib/python2.7/site-packages/pyfaidx/__init__.pyc in complement(self)
160 TAGCAT
161 """
--> 162 comp = self.__class__(self.name, complement(self.seq),
163 start=self.start, end=self.end)
164 comp.comp = False if self.comp else True
/Users/tim/venvs/analysis-venv-2.7/lib/python2.7/site-packages/pyfaidx/__init__.pyc in complement(seq)
761 else:
762 matches = re.findall(dna_bases, seq)
--> 763 position = len(matches[0])
764 raise ValueError("Sequence contains non-DNA character '{0}' at position {1:n}\n".format(seq[position], position + 1))
765
IndexError: list index out of range
I'm happy to make a PR that addresses this if you like.