gootsaud / bike-riding

Unguarded next inside generator PTC-W0063
Bug risk
Critical
2 years ago2 years old
Call to next() should be wrapped in try-except
 607            rv = self._after
 608            self._after = missing
 609        else:
 610            rv = next(self._iterator) 611
 612        self.index0 += 1
 613        self._before = self._current
Call to next() should be wrapped in try-except
 372                }
 373                and self.stream.look().test("name:context")
 374            ):
 375                node.with_context = next(self.stream).value == "with" 376                self.stream.skip()
 377                return True
 378            return False
Call to next() should be wrapped in try-except
 951            negated = False
 952        name = self.stream.expect("name").value
 953        while self.stream.current.type == "dot":
 954            next(self.stream) 955            name += "." + self.stream.expect("name").value
 956        dyn_args = dyn_kwargs = None
 957        kwargs = []
Call to next() should be wrapped in try-except
 945    def parse_test(self, node: nodes.Expr) -> nodes.Expr:
 946        token = next(self.stream)
 947        if self.stream.current.test("name:not"):
 948            next(self.stream) 949            negated = True
 950        else:
 951            negated = False
Call to next() should be wrapped in try-except
 943        return node
 944
 945    def parse_test(self, node: nodes.Expr) -> nodes.Expr:
 946        token = next(self.stream) 947        if self.stream.current.test("name:not"):
 948            next(self.stream)
 949            negated = True