DeprecationWarning: generator ... raised StopIteration
See original GitHub issueFYI, I’m getting a DepreciationWarning in two places when usingpysmt.shortcuts.read_smtlib()
:
.../env/lib/python3.6/site-packages/pysmt/smtlib/parser.py:179: DeprecationWarning: generator 'Tokenizer.create_generator' raised StopIteration
return next(self.generator)
.../env/lib/python3.6/site-packages/pysmt/smtlib/parser.py:796: DeprecationWarning: generator 'SmtLibParser.get_command' raised StopIteration
for cmd in self.get_command(tokens):
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to get rid of warning "DeprecationWarning generator ...
This is happening because ngrams is raising StopIteration exception to end a generator, and this is deprecated from Python 3.5.
Read more >Python deprecationwarning generator raised StopIteration, Python ...
This is happening because ngrams is raising StopIteration exception to end a generator, and this is deprecated from Python 3.5. You could get...
Read more >PEP 479 – Change StopIteration handling inside generators
This PEP proposes a change to generators: when StopIteration is raised inside ... silent deprecation warning if StopIteration bubbles out of a generator...
Read more >Python 3.7: StopIteration could be your next headache
Flag generator is exhausted raise StopIteration ... As I upgraded from 3.5 to 3.7, I didn't get any deprecation warning.
Read more >Python agent throwing noisy deprecation warning in logs
/usr/local/lib/python3.6/contextlib.py:99: DeprecationWarning: generator 'common_exception_handling' raised StopIteration ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting this. This is an issue that comes after python 3.4, that we have not yet cleaned-up. See https://www.python.org/dev/peps/pep-0479/#consequences-for-existing-code
We fall in the slightly more complex example discussed there. Wrapping the calls to next with a try/except should be sufficient to avoid the exception to surface. If you want to try to create a patch for this issue, I would be glad to support you!
Steps to reproduce the error: