Closed HHArrowood closed 3 years ago
In Python 3.7 and above, StopIteration exceptions raised directly or indirectly in coroutines and generators are transformed into RuntimeError exceptions. This means that the next() https://github.com/bryanyang0528/ksql-python/blob/9d650a067a71c97fb169c521ba54985189f56a33/ksql/utils.py#L103 will break things if it reaches the end of the results generator. See the discussion here: https://stackoverflow.com/questions/51700960/runtimeerror-generator-raised-stopiteration-every-time-i-try-to-run-app.
next()
To fix this, simply replace the line mentioned above with
try: header = next(results) except StopIteration: return
Hi @HHArrowood ,
Thank you for pointing out this issue. Would you mind submitting a new PR for fixing this?
In Python 3.7 and above, StopIteration exceptions raised directly or indirectly in coroutines and generators are transformed into RuntimeError exceptions. This means that the
next()
https://github.com/bryanyang0528/ksql-python/blob/9d650a067a71c97fb169c521ba54985189f56a33/ksql/utils.py#L103 will break things if it reaches the end of the results generator. See the discussion here: https://stackoverflow.com/questions/51700960/runtimeerror-generator-raised-stopiteration-every-time-i-try-to-run-app.To fix this, simply replace the line mentioned above with