From efd05a475475ed25db9016be6e04e39f92ef3b19 Mon Sep 17 00:00:00 2001 From: Kip Yin <28321392+kipyin@users.noreply.github.com> Date: Mon, 4 Feb 2019 16:37:44 +0800 Subject: [PATCH] So raising StopIteration is correct? --- pokedex/db/translations.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pokedex/db/translations.py b/pokedex/db/translations.py index 67c793a..8f55473 100755 --- a/pokedex/db/translations.py +++ b/pokedex/db/translations.py @@ -377,10 +377,7 @@ def group_by_object(stream): Yields ((class name, object ID), (list of messages)) pairs. """ stream = iter(stream) - try: - current = next(stream) - except StopIteration: - yield StopIteration + current = next(stream) current_key = current.cls, current.id group = [current] for message in stream: