Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 18933:09df3254b49d legacy-trunk
Merge of descr-branch back into trunk.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Thu, 02 Aug 2001 04:15:00 +0000 |
| parents | a8b1acc7a21f |
| children | 4df72ea78ae8 |
comparison
equal
deleted
inserted
replaced
| 18932:dab95ca8acfc | 18933:09df3254b49d |
|---|---|
| 113 tstate = PyThreadState_New(interp); | 113 tstate = PyThreadState_New(interp); |
| 114 if (tstate == NULL) | 114 if (tstate == NULL) |
| 115 Py_FatalError("Py_Initialize: can't make first thread"); | 115 Py_FatalError("Py_Initialize: can't make first thread"); |
| 116 (void) PyThreadState_Swap(tstate); | 116 (void) PyThreadState_Swap(tstate); |
| 117 | 117 |
| 118 if (PyType_InitDict(&PyType_Type) < 0) | |
| 119 Py_FatalError("Py_Initialize: can't initialize 'type'"); | |
| 120 | |
| 118 interp->modules = PyDict_New(); | 121 interp->modules = PyDict_New(); |
| 119 if (interp->modules == NULL) | 122 if (interp->modules == NULL) |
| 120 Py_FatalError("Py_Initialize: can't make modules dictionary"); | 123 Py_FatalError("Py_Initialize: can't make modules dictionary"); |
| 121 | 124 |
| 122 /* Init codec registry */ | 125 /* Init codec registry */ |
| 142 interp->modules); | 145 interp->modules); |
| 143 | 146 |
| 144 _PyImport_Init(); | 147 _PyImport_Init(); |
| 145 | 148 |
| 146 /* initialize builtin exceptions */ | 149 /* initialize builtin exceptions */ |
| 147 init_exceptions(); | 150 _PyExc_Init(); |
| 148 | 151 |
| 149 /* phase 2 of builtins */ | 152 /* phase 2 of builtins */ |
| 150 _PyImport_FixupExtension("__builtin__", "__builtin__"); | 153 _PyImport_FixupExtension("__builtin__", "__builtin__"); |
| 151 | 154 |
| 152 initsigs(); /* Signal handling stuff, including initintr() */ | 155 initsigs(); /* Signal handling stuff, including initintr() */ |
| 236 /* Now we decref the exception classes. After this point nothing | 239 /* Now we decref the exception classes. After this point nothing |
| 237 can raise an exception. That's okay, because each Fini() method | 240 can raise an exception. That's okay, because each Fini() method |
| 238 below has been checked to make sure no exceptions are ever | 241 below has been checked to make sure no exceptions are ever |
| 239 raised. | 242 raised. |
| 240 */ | 243 */ |
| 241 fini_exceptions(); | 244 _PyExc_Fini(); |
| 242 | 245 |
| 243 /* Delete current thread */ | 246 /* Delete current thread */ |
| 244 PyInterpreterState_Clear(interp); | 247 PyInterpreterState_Clear(interp); |
| 245 PyThreadState_Swap(NULL); | 248 PyThreadState_Swap(NULL); |
| 246 PyInterpreterState_Delete(interp); | 249 PyInterpreterState_Delete(interp); |
| 1343 int | 1346 int |
| 1344 _Py_AskYesNo(char *prompt) | 1347 _Py_AskYesNo(char *prompt) |
| 1345 { | 1348 { |
| 1346 char buf[256]; | 1349 char buf[256]; |
| 1347 | 1350 |
| 1348 printf("%s [ny] ", prompt); | 1351 fprintf(stderr, "%s [ny] ", prompt); |
| 1349 if (fgets(buf, sizeof buf, stdin) == NULL) | 1352 if (fgets(buf, sizeof buf, stdin) == NULL) |
| 1350 return 0; | 1353 return 0; |
| 1351 return buf[0] == 'y' || buf[0] == 'Y'; | 1354 return buf[0] == 'y' || buf[0] == 'Y'; |
| 1352 } | 1355 } |
| 1353 #endif | 1356 #endif |
