Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd228825

Browse files
authored
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.
1 parente5252c6 commitd228825

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

‎Include/cpython/pythonrun.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,4 @@ PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject
117117

118118
/* Stuff with no proper home (yet) */
119119
PyAPI_FUNC(char*)PyOS_Readline(FILE*,FILE*,constchar*);
120-
PyAPI_DATA(PyThreadState*)_PyOS_ReadlineTState;
121120
PyAPI_DATA(char)*(*PyOS_ReadlineFunctionPointer)(FILE*,FILE*,constchar*);

‎Modules/readline.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,9 @@ rlhandler(char *text)
13131313
staticchar*
13141314
readline_until_enter_or_signal(constchar*prompt,int*signal)
13151315
{
1316+
// Defined in Parser/myreadline.c
1317+
externPyThreadState*_PyOS_ReadlineTState;
1318+
13161319
char*not_done_reading="";
13171320
fd_setselectset;
13181321

‎Parser/myreadline.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
#endif/* MS_WINDOWS */
2121

2222

23-
PyThreadState*_PyOS_ReadlineTState=NULL;
23+
// Export the symbol since it's used by the readline shared extension
24+
PyAPI_DATA(PyThreadState*)_PyOS_ReadlineTState;
25+
PyThreadState*_PyOS_ReadlineTState=NULL;
2426

2527
staticPyThread_type_lock_PyOS_ReadlineLock=NULL;
2628

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp