]> granicus.if.org Git - python/commitdiff
PyThreadState_Swap(NULL) didn't do what I thought it did. Fixes
authorMichael W. Hudson <mwh@python.net>
Thu, 8 Jul 2004 15:28:26 +0000 (15:28 +0000)
committerMichael W. Hudson <mwh@python.net>
Thu, 8 Jul 2004 15:28:26 +0000 (15:28 +0000)
[ 987287 ] Python 2.4a1, interpreter hanging on Keyboard Interrupt

Modules/readline.c
Parser/myreadline.c

index 8285d33afdb5ea843c8bfe749df0c3b1963c74f0..abcc9c64863c4d4ec434e7bd842c3db546993591 100644 (file)
@@ -700,7 +700,7 @@ readline_until_enter_or_signal(char *prompt, int *signal)
                        int s;
                        PyEval_RestoreThread(_PyOS_ReadlineTState);
                        s = PyErr_CheckSignals();
-                       PyThreadState_Swap(NULL);       
+                       PyEval_SaveThread();    
                        if (s < 0) {
                                rl_free_line_state();
                                rl_cleanup_after_signal();
index 979e34f00d647d781e8646e794cb2e94f27d4b60..7fc421e9d10a0f6ea991281d815b7477393f01d1 100644 (file)
@@ -84,7 +84,7 @@ my_fgets(char *buf, int len, FILE *fp)
                        int s;
                        PyEval_RestoreThread(_PyOS_ReadlineTState);
                        s = PyErr_CheckSignals();
-                       PyThreadState_Swap(NULL);
+                       PyEval_SaveThread();
                        if (s < 0) {
                                return 1;
                        }