Python SyntaxError: (“‘return’ with argument inside generator”,)
You cannot use return with a value to exit a generator in Python 2, or Python 3.0 – 3.2. You need to use yield plus a return without an expression: if response.error: self.error(“Error while retrieving the status”) self.finish() yield error return In the loop itself, use yield again: for line in response.body.split(“\n”): if line != … Read more