def _split(self, iterator, tmp_dir):
        fnames = []
        for i, lines in enumerate(iterator):
            lines = list(lines)
            out_fname = os.path.join(tmp_dir, self.TMP_FNAME.format(i + 1))
            self._write(lines, out_fname)
            fnames.append(out_fname)
            if len(lines) < self.max_lines:
                break
        return fnames