gh-106320: Remove _PyOS_ReadlineTState API (#107034)

Remove _PyOS_ReadlineTState variable from the public C API.
The symbol is still exported for the readline shared extension.
This commit is contained in:
Victor Stinner 2023-07-22 16:45:56 +02:00 committed by GitHub
parent e5252c6127
commit d228825e08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -117,5 +117,4 @@ PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject
/* Stuff with no proper home (yet) */
PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *);
PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);

View File

@ -1313,6 +1313,9 @@ rlhandler(char *text)
static char *
readline_until_enter_or_signal(const char *prompt, int *signal)
{
// Defined in Parser/myreadline.c
extern PyThreadState *_PyOS_ReadlineTState;
char * not_done_reading = "";
fd_set selectset;

View File

@ -20,6 +20,8 @@
#endif /* MS_WINDOWS */
// Export the symbol since it's used by the readline shared extension
PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
PyThreadState *_PyOS_ReadlineTState = NULL;
static PyThread_type_lock _PyOS_ReadlineLock = NULL;