diff options
author | Seth M Morton <seth.m.morton@gmail.com> | 2018-07-01 23:36:56 -0700 |
---|---|---|
committer | Seth M Morton <seth.m.morton@gmail.com> | 2018-07-01 23:36:56 -0700 |
commit | c8f67ca50c69c41383a88511aca528acae5ce6da (patch) | |
tree | 8938ae4b68d7474938cd8bc91eac9a3a03d3ee8c | |
parent | 31b75e5d2bf68946f3f0d023a829122b768c71e1 (diff) | |
download | natsort-c8f67ca50c69c41383a88511aca528acae5ce6da.tar.gz |
Fix StopIteration error on Python 3.7.
-rw-r--r-- | test_natsort/slow_splitters.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test_natsort/slow_splitters.py b/test_natsort/slow_splitters.py index f3cd76e..cd36161 100644 --- a/test_natsort/slow_splitters.py +++ b/test_natsort/slow_splitters.py @@ -304,7 +304,10 @@ def sep_inserter(iterable, sep, types=frozenset((int, long, float))): pairs = pairwise(iterable) # Prime loop by handling first pair specially. - first, second = next(pairs) + try: + first, second = next(pairs) + except StopIteration: + return if second is None: # Only one element yield first elif type(first) in types and type(second) in types: |