Commit 59bff399 authored by Guido van Rossum's avatar Guido van Rossum

Add sys.exitfunc feature. Make askync non-static.

parent da8cd863
...@@ -369,6 +369,25 @@ void ...@@ -369,6 +369,25 @@ void
goaway(sts) goaway(sts)
int 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(); flushline();
#ifdef USE_THREAD #ifdef USE_THREAD
...@@ -411,7 +430,7 @@ goaway(sts) ...@@ -411,7 +430,7 @@ goaway(sts)
#ifdef TRACE_REFS #ifdef TRACE_REFS
/* Ask a yes/no question */ /* Ask a yes/no question */
static int int
askyesno(prompt) askyesno(prompt)
char *prompt; char *prompt;
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment