Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b7e898a

Browse files
committed
"#if WITH_THREAD" is incorrect; must be #ifdef instead; WITH_THREAD
isn't always set to an integer value when it's defined.
1 parent 30ea2f2 commit b7e898a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Parser/myreadline.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern char* vms__StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
2222

2323
PyThreadState* _PyOS_ReadlineTState;
2424

25-
#if WITH_THREAD
25+
#ifdef WITH_THREAD
2626
#include "pythread.h"
2727
static PyThread_type_lock _PyOS_ReadlineLock = NULL;
2828
#endif
@@ -181,15 +181,15 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
181181
#endif
182182
}
183183

184-
#if WITH_THREAD
184+
#ifdef WITH_THREAD
185185
if (_PyOS_ReadlineLock == NULL) {
186186
_PyOS_ReadlineLock = PyThread_allocate_lock();
187187
}
188188
#endif
189189

190190
_PyOS_ReadlineTState = PyThreadState_GET();
191191
Py_BEGIN_ALLOW_THREADS
192-
#if WITH_THREAD
192+
#ifdef WITH_THREAD
193193
PyThread_acquire_lock(_PyOS_ReadlineLock, 1);
194194
#endif
195195

@@ -205,7 +205,7 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
205205
prompt);
206206
Py_END_ALLOW_THREADS
207207

208-
#if WITH_THREAD
208+
#ifdef WITH_THREAD
209209
PyThread_release_lock(_PyOS_ReadlineLock);
210210
#endif
211211

0 commit comments

Comments
 (0)