Skip to content

Commit

Permalink
Merge pull request #219 from persephone-tools/python37-compat
Browse files Browse the repository at this point in the history
[MRG] Make code 3.7 compatible
  • Loading branch information
shuttle1987 committed Jul 1, 2019
2 parents db90d6b + b6a9c58 commit 286d74f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion persephone/corpus_reader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" An CorpusReader class that interfaces with preprocessed corpora."""
from __future__ import generator_stop

import logging
import logging.config
Expand Down Expand Up @@ -141,7 +142,8 @@ def train_batch_gen(self) -> Iterator:
pprint.pformat(fn_batch))
yield self.load_batch(fn_batch)
else:
raise StopIteration
# Python 3.7 compatible way to mark generator as exhausted
return

def valid_batch(self):
""" Returns a single batch with all the validation cases."""
Expand Down

0 comments on commit 286d74f

Please sign in to comment.