This duplicates the behavior whening normally printing exceptions.
>>> g.next()
>>> del g
>>> sys.stderr.getvalue().startswith(
-... "Exception exceptions.RuntimeError: 'generator ignored GeneratorExit' in "
+... "Exception RuntimeError: 'generator ignored GeneratorExit' in "
... )
True
>>> sys.stderr = old
... del l
... err = sys.stderr.getvalue().strip()
... err.startswith(
-... "Exception exceptions.RuntimeError: RuntimeError() in <"
+... "Exception RuntimeError: RuntimeError() in <"
... )
... err.endswith("> ignored")
... len(err.splitlines())
Core and builtins
-----------------
+- When printing an unraisable error, don't print exceptions. before the name.
+ This duplicates the behavior whening normally printing exceptions.
+
- Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
- PEP 352: Raising a string exception now triggers a TypeError. Attempting to
PyFile_WriteString("<unknown>", f);
else {
char* modstr = PyString_AsString(moduleName);
- if (modstr)
+ if (modstr &&
+ strcmp(modstr, "exceptions") != 0)
{
PyFile_WriteString(modstr, f);
PyFile_WriteString(".", f);