From c941a77d162eb1a43ac8f17a82b80294ce3b0ce5 Mon Sep 17 00:00:00 2001 From: inpos Date: Sun, 26 Nov 2017 17:31:10 +0300 Subject: [PATCH] return inside generator --- resources/scrapers/tmdb.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/scrapers/tmdb.py b/resources/scrapers/tmdb.py index 0b7344e..f0fc9f4 100644 --- a/resources/scrapers/tmdb.py +++ b/resources/scrapers/tmdb.py @@ -145,10 +145,11 @@ class Movies(Core): def iter_results(self): if 'results' in self.movies.keys(): - for i in self.movies["results"]: - yield i + res = self.movies["results"] else: - return [] + res = [] + for i in self.movies["results"]: + yield i def get_ordered_matches(self): """