Mercurial > cpython-lru_cache-weakref
comparison Python/pythonmain.c @ 94:dac8625c8d9b legacy-trunk
Changes for THINK C 4.0.
Don't call inittime() and initmath(), let config_*.c decide about those.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 20 Dec 1990 23:11:33 +0000 |
| parents | a6934380c6e7 |
| children | 853b736a6a9e |
comparison
equal
deleted
inserted
replaced
| 93:9e051fc7073e | 94:dac8625c8d9b |
|---|---|
| 57 { | 57 { |
| 58 static int inited; | 58 static int inited; |
| 59 | 59 |
| 60 if (inited) | 60 if (inited) |
| 61 return; | 61 return; |
| 62 inited = 1; | |
| 62 | 63 |
| 63 initimport(); | 64 initimport(); |
| 65 | |
| 66 /* Modules 'builtin' and 'sys' are initialized here, | |
| 67 they are needed by random bits of the interpreter. | |
| 68 All other modules are optional and should be initialized | |
| 69 by the initcalls() of a specific configuration. */ | |
| 64 | 70 |
| 65 initbuiltin(); /* Also initializes builtin exceptions */ | 71 initbuiltin(); /* Also initializes builtin exceptions */ |
| 66 initsys(); | 72 initsys(); |
| 67 inittime(); | |
| 68 initmath(); | |
| 69 | 73 |
| 70 initcalls(); /* Configuration-dependent initializations */ | 74 initcalls(); /* Configuration-dependent initializations */ |
| 71 | 75 |
| 72 initintr(); /* For intrcheck() */ | 76 initintr(); /* For intrcheck() */ |
| 73 | |
| 74 inited = 1; | |
| 75 } | 77 } |
| 76 | 78 |
| 77 /* Parse input from a file and execute it */ | 79 /* Parse input from a file and execute it */ |
| 78 | 80 |
| 79 int | 81 int |
| 338 | 340 |
| 339 #ifdef REF_DEBUG | 341 #ifdef REF_DEBUG |
| 340 fprintf(stderr, "[%ld refs]\n", ref_total); | 342 fprintf(stderr, "[%ld refs]\n", ref_total); |
| 341 #endif | 343 #endif |
| 342 | 344 |
| 343 #ifdef THINK_C | 345 #ifdef THINK_C_3_0 |
| 344 if (sts == 0) | 346 if (sts == 0) |
| 345 Click_On(0); | 347 Click_On(0); |
| 346 #endif | 348 #endif |
| 347 | 349 |
| 348 #ifdef TRACE_REFS | 350 #ifdef TRACE_REFS |
| 349 if (askyesno("Print left references?")) { | 351 if (askyesno("Print left references?")) { |
| 350 #ifdef THINK_C | 352 #ifdef THINK_C_3_0 |
| 351 Click_On(1); | 353 Click_On(1); |
| 352 #endif | 354 #endif |
| 353 printrefs(stderr); | 355 printrefs(stderr); |
| 354 } | 356 } |
| 355 #endif /* TRACE_REFS */ | 357 #endif /* TRACE_REFS */ |
| 362 finaloutput() | 364 finaloutput() |
| 363 { | 365 { |
| 364 #ifdef TRACE_REFS | 366 #ifdef TRACE_REFS |
| 365 if (!askyesno("Print left references?")) | 367 if (!askyesno("Print left references?")) |
| 366 return; | 368 return; |
| 367 #ifdef THINK_C | 369 #ifdef THINK_C_3_0 |
| 368 Click_On(1); | 370 Click_On(1); |
| 369 #endif /* THINK_C */ | 371 #endif |
| 370 printrefs(stderr); | 372 printrefs(stderr); |
| 371 #endif /* TRACE_REFS */ | 373 #endif /* TRACE_REFS */ |
| 372 } | 374 } |
| 373 | 375 |
| 374 /* Ask a yes/no question */ | 376 /* Ask a yes/no question */ |
| 383 if (fgets(buf, sizeof buf, stdin) == NULL) | 385 if (fgets(buf, sizeof buf, stdin) == NULL) |
| 384 return 0; | 386 return 0; |
| 385 return buf[0] == 'y' || buf[0] == 'Y'; | 387 return buf[0] == 'y' || buf[0] == 'Y'; |
| 386 } | 388 } |
| 387 | 389 |
| 388 #ifdef THINK_C | 390 #ifdef THINK_C_3_0 |
| 389 | 391 |
| 390 /* Check for file descriptor connected to interactive device. | 392 /* Check for file descriptor connected to interactive device. |
| 391 Pretend that stdin is always interactive, other files never. */ | 393 Pretend that stdin is always interactive, other files never. */ |
| 392 | 394 |
| 393 int | 395 int |
