Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 1015:f3d5e2c3b9a3 legacy-trunk
Add sys.exitfunc feature. Make askync non-static.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 03 Sep 1992 20:28:00 +0000 |
| parents | a31e07847063 |
| children | 2c0432fcc270 |
comparison
equal
deleted
inserted
replaced
| 1014:96acb35bb92b | 1015:f3d5e2c3b9a3 |
|---|---|
| 367 | 367 |
| 368 void | 368 void |
| 369 goaway(sts) | 369 goaway(sts) |
| 370 int sts; | 370 int sts; |
| 371 { | 371 { |
| 372 object *exitfunc = sysget("exitfunc"); | |
| 373 | |
| 374 if (exitfunc) { | |
| 375 object *arg; | |
| 376 object *res; | |
| 377 sysset("exitfunc", (object *)NULL); | |
| 378 arg = newtupleobject(0); | |
| 379 if (arg == NULL) | |
| 380 res = NULL; | |
| 381 else { | |
| 382 res = call_object(exitfunc, arg); | |
| 383 DECREF(arg); | |
| 384 } | |
| 385 if (res == NULL) { | |
| 386 fprintf(stderr, "Error in sys.exitfunc:\n"); | |
| 387 print_error(); | |
| 388 } | |
| 389 } | |
| 390 | |
| 372 flushline(); | 391 flushline(); |
| 373 | 392 |
| 374 #ifdef USE_THREAD | 393 #ifdef USE_THREAD |
| 375 | 394 |
| 376 /* Other threads may still be active, so skip most of the | 395 /* Other threads may still be active, so skip most of the |
| 409 } | 428 } |
| 410 | 429 |
| 411 #ifdef TRACE_REFS | 430 #ifdef TRACE_REFS |
| 412 /* Ask a yes/no question */ | 431 /* Ask a yes/no question */ |
| 413 | 432 |
| 414 static int | 433 int |
| 415 askyesno(prompt) | 434 askyesno(prompt) |
| 416 char *prompt; | 435 char *prompt; |
| 417 { | 436 { |
| 418 char buf[256]; | 437 char buf[256]; |
| 419 | 438 |
