-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
bpo-38631: Replace compiler fatal errors with exceptions #24369
Conversation
* Replace Py_FatalError() calls with regular SystemError exceptions. * compiler_exit_scope() calls _PyErr_WriteUnraisableMsg() to log the PySequence_DelItem() failure. * compiler_unit_check() uses _PyMem_IsPtrFreed() * compiler_make_closure(): remove "(reftype == FREE)" comment since reftype can also be LOCAL or GLOBAL_EXPLICIT.
cc @isidentical @lysnikolaou @pablogsal I injected bugs to check if the SystemError error message is formatted properly. Error 1:
Error 2:
Error 3:
It seems like if
|
arg = compiler_lookup_arg(c->u->u_cellvars, name); | ||
else /* (reftype == FREE) */ | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, preserve the comment for the else branch: /* (reftype == FREE) */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, preserve the comment for the else branch: /* (reftype == FREE) */
See the commit message: the comment is wrong. Try to convert the comment into an assertion.
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
) * Replace Py_FatalError() calls with regular SystemError exceptions. * compiler_exit_scope() calls _PyErr_WriteUnraisableMsg() to log the PySequence_DelItem() failure. * compiler_unit_check() uses _PyMem_IsPtrFreed(). * compiler_make_closure(): remove "(reftype == FREE)" comment since reftype can also be LOCAL or GLOBAL_EXPLICIT.
PySequence_DelItem() failure.
reftype can also be LOCAL or GLOBAL_EXPLICIT.
https://bugs.python.org/issue38631