summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-09-03 20:28:00 (GMT)
committerGuido van Rossum <guido@python.org>1992-09-03 20:28:00 (GMT)
commit59bff399a08b29b93b9d87c422f7077fc75c2a2a (patch)
tree629753c28932d1c25eb867ceaac841cebd926bf9 /Python/pythonrun.c
parentda8cd8638f0ad6cb3f3393a7637b9b87686af737 (diff)
downloadcpython-59bff399a08b29b93b9d87c422f7077fc75c2a2a.zip
cpython-59bff399a08b29b93b9d87c422f7077fc75c2a2a.tar.gz
cpython-59bff399a08b29b93b9d87c422f7077fc75c2a2a.tar.bz2
Add sys.exitfunc feature. Make askync non-static.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 5358ee5..35b1815 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -369,6 +369,25 @@ void
goaway(sts)
int sts;
{
+ object *exitfunc = sysget("exitfunc");
+
+ if (exitfunc) {
+ object *arg;
+ object *res;
+ sysset("exitfunc", (object *)NULL);
+ arg = newtupleobject(0);
+ if (arg == NULL)
+ res = NULL;
+ else {
+ res = call_object(exitfunc, arg);
+ DECREF(arg);
+ }
+ if (res == NULL) {
+ fprintf(stderr, "Error in sys.exitfunc:\n");
+ print_error();
+ }
+ }
+
flushline();
#ifdef USE_THREAD
@@ -411,7 +430,7 @@ goaway(sts)
#ifdef TRACE_REFS
/* Ask a yes/no question */
-static int
+int
askyesno(prompt)
char *prompt;
{