New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for tp_iter in ceval:ext_do_call before overriding exception message #49468
Comments
Hi, I find it weird that given this sample code: def g():
yield iter(None)
list(*g()) I get this traceback: Traceback (most recent call last):
File "a1.py", line 3, in <module>
list(*g())
TypeError: type object argument after * must be a sequence, not generator At a minimum the exception message looks awkward to me. With the Traceback (most recent call last):
File "a1.py", line 3, in <module>
list(*g())
File "a1.py", line 2, in g
yield iter(None)
TypeError: 'NoneType' object is not iterable |
(Btw, the suggestion to check for tp_iter came from Antoine Pitrou. It |
You must check tp_iter as well, not only Py_TPFLAGS_HAVE_ITER. |
Thanks for taking a look, my bad for taking so long to reply. I'm adding a new patch now. This one, besides the fix needed mentioned |
Is this ready to commit? |
See also bpo-4806 |
This is one of 4 duplicate issues, 3 with somewhat similar patches, with nearly disjoint nosy lists. Consolidating. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: