-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Formalize incomplete error exceptions to improve codeop module handling #113744
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
Comments
…incomplete input detection in the codeop module
…incomplete input detection in the codeop module Signed-off-by: Pablo Galindo <[email protected]>
…incomplete input detection in the codeop module Signed-off-by: Pablo Galindo <[email protected]>
…incomplete input detection in the codeop module Signed-off-by: Pablo Galindo <[email protected]>
…mprove incomplete input detection in the codeop module
…mprove incomplete input detection in the codeop module Signed-off-by: Pablo Galindo <[email protected]>
…lete input detection in the codeop module (#113745) Signed-off-by: Pablo Galindo <[email protected]>
Since |
(If you want to delegate this to me, let me know. Currently I'd lean toward not including it in |
I think is fine to have it in I am fine removing it from the C-API 👍 WDYT? |
Sounds good. It can always be added :) |
@encukou can you refresh my memory on how can I make the API check not complain? Marking the exception as extern? Or there is a better way? |
…incomplete input detection in the codeop module (python#113745) Signed-off-by: Pablo Galindo <[email protected]>
@encukou gentle ping |
Sorry, I missed this notification. Not sure which check you have in mind. If you have a PR where you just need to silence a check, could you send it? I assume it's the Docs check? The exception either needs to be documented, or removed from limited API like this: --- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -108,7 +108,9 @@ PyAPI_DATA(PyObject *) PyExc_NotImplementedError;
PyAPI_DATA(PyObject *) PyExc_SyntaxError;
PyAPI_DATA(PyObject *) PyExc_IndentationError;
PyAPI_DATA(PyObject *) PyExc_TabError;
+#if !defined(Py_LIMITED_API)
PyAPI_DATA(PyObject *) PyExc_IncompleteInputError;
+#endif
PyAPI_DATA(PyObject *) PyExc_ReferenceError;
PyAPI_DATA(PyObject *) PyExc_SystemError;
PyAPI_DATA(PyObject *) PyExc_SystemExit;
diff --git a/Misc/stable_abi.toml b/Misc/stable_abi.toml
index ca7cf029615..a7fb8e3c327 100644
--- a/Misc/stable_abi.toml
+++ b/Misc/stable_abi.toml
@@ -2485,8 +2485,6 @@
[function._Py_SetRefcnt]
added = '3.13'
abi_only = true
-[data.PyExc_IncompleteInputError]
- added = '3.13'
[function.PyList_GetItemRef]
added = '3.13'
[typedef.PyCFunctionFast]
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 68d7985dac8..9b7321e5ad5 100644 and run Or to make it fully internal, move the declaration to |
@encukou I am getting this:
and this doesn't go away when running |
Use the |
Hi @pablogsal, is this good to close since #113745 is merged? |
Currently the way we detect incomplete errors in the
codeop
module is based on the exception text, which is suboptimal at least. To do this properly, add a newSyntaxError
subclass calledIncompleteInputError
and use that in the codeop module to detect errors from the parser.Linked PRs
The text was updated successfully, but these errors were encountered: