comparison Python/pythonrun.c @ 31797:846b3ee7e106 legacy-trunk

Changed random calls to PyThreadState_Get() to use the macro
author Nicholas Bastin <nick.bastin@gmail.com>
date Wed, 24 Mar 2004 22:22:12 +0000
parents 76053a1dd452
children 78bd25b42d46
comparison
equal deleted inserted replaced
31796:1c117dbb2def 31797:846b3ee7e106
314 */ 314 */
315 call_sys_exitfunc(); 315 call_sys_exitfunc();
316 initialized = 0; 316 initialized = 0;
317 317
318 /* Get current thread state and interpreter pointer */ 318 /* Get current thread state and interpreter pointer */
319 tstate = PyThreadState_Get(); 319 tstate = PyThreadState_GET();
320 interp = tstate->interp; 320 interp = tstate->interp;
321 321
322 /* Disable signal handling */ 322 /* Disable signal handling */
323 PyOS_FiniInterrupts(); 323 PyOS_FiniInterrupts();
324 324
527 void 527 void
528 Py_EndInterpreter(PyThreadState *tstate) 528 Py_EndInterpreter(PyThreadState *tstate)
529 { 529 {
530 PyInterpreterState *interp = tstate->interp; 530 PyInterpreterState *interp = tstate->interp;
531 531
532 if (tstate != PyThreadState_Get()) 532 if (tstate != PyThreadState_GET())
533 Py_FatalError("Py_EndInterpreter: thread is not current"); 533 Py_FatalError("Py_EndInterpreter: thread is not current");
534 if (tstate->frame != NULL) 534 if (tstate->frame != NULL)
535 Py_FatalError("Py_EndInterpreter: thread still has a frame"); 535 Py_FatalError("Py_EndInterpreter: thread still has a frame");
536 if (tstate != interp->tstate_head || tstate->next != NULL) 536 if (tstate != interp->tstate_head || tstate->next != NULL)
537 Py_FatalError("Py_EndInterpreter: not the last thread"); 537 Py_FatalError("Py_EndInterpreter: not the last thread");
1459 case E_TOODEEP: 1459 case E_TOODEEP:
1460 errtype = PyExc_IndentationError; 1460 errtype = PyExc_IndentationError;
1461 msg = "too many levels of indentation"; 1461 msg = "too many levels of indentation";
1462 break; 1462 break;
1463 case E_DECODE: { /* XXX */ 1463 case E_DECODE: { /* XXX */
1464 PyThreadState* tstate = PyThreadState_Get(); 1464 PyThreadState* tstate = PyThreadState_GET();
1465 PyObject* value = tstate->curexc_value; 1465 PyObject* value = tstate->curexc_value;
1466 if (value != NULL) { 1466 if (value != NULL) {
1467 u = PyObject_Repr(value); 1467 u = PyObject_Repr(value);
1468 if (u != NULL) { 1468 if (u != NULL) {
1469 msg = PyString_AsString(u); 1469 msg = PyString_AsString(u);