From 38b260228afe1381f7a342f3d3adae3da869dc01 Mon Sep 17 00:00:00 2001 From: sulyi Date: Sun, 3 Jun 2018 23:54:49 +0200 Subject: [PATCH] [jsinterp] Complying with PEP 479 --- youtube_dl/jsinterp2/jsparser.py | 3 +-- youtube_dl/jsinterp2/tstream.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/youtube_dl/jsinterp2/jsparser.py b/youtube_dl/jsinterp2/jsparser.py index a50337595..6da7ba61b 100644 --- a/youtube_dl/jsinterp2/jsparser.py +++ b/youtube_dl/jsinterp2/jsparser.py @@ -16,8 +16,7 @@ class Parser(object): def parse(self): while not self.token_stream.ended: yield self._source_element(self.stack_top) - raise StopIteration - + def _source_element(self, stack_top): if stack_top < 0: raise ExtractorError('Recursion limit reached') diff --git a/youtube_dl/jsinterp2/tstream.py b/youtube_dl/jsinterp2/tstream.py index 55bb87985..f615864f8 100644 --- a/youtube_dl/jsinterp2/tstream.py +++ b/youtube_dl/jsinterp2/tstream.py @@ -154,8 +154,7 @@ class TokenStream(object): self.ended = True else: raise ExtractorError('Unrecognised sequence at %d' % pos) - raise StopIteration - + def chk_id(self, last=False): if last: name, value, pos = self._last