Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-106320: Remove _PyOS_ReadlineTState API
Remove _PyOS_ReadlineTState from the public C API. The symbol is
still exported for the readline shared extension.
  • Loading branch information
vstinner committed Jul 22, 2023
commit 40f2b6fac9656f128889e77675e71ca207c7cd49
1 change: 0 additions & 1 deletion Include/cpython/pythonrun.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
3 changes: 3 additions & 0 deletions Modules/readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion Parser/myreadline.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
#endif /* MS_WINDOWS */


PyThreadState* _PyOS_ReadlineTState = NULL;
// 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;

Expand Down