diff --git a/Modules/cgensupport.c b/Modules/cgensupport.c index 5f3ad047f97..69514673061 100644 --- a/Modules/cgensupport.c +++ b/Modules/cgensupport.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 39dcc411b2f..c553be60aa0 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved @@ -922,16 +922,31 @@ builtin_pow(self, args) } if (coerce(&v, &w) != 0) return NULL; - if (z!=None) { - if (coerce(&w, &z) != 0) - return NULL; - if (coerce(&v, &z) != 0) - return NULL; + if (z == None) { + x = (*v->ob_type->tp_as_number->nb_power)(v, w, z); + } + else { + object *v1, *z1, *w2, *z2; + x = NULL; + v1 = v; + z1 = z; + if (coerce(&v1, &z1) != 0) + goto error2; + w2 = w; + z2 = z1; + if (coerce(&w2, &z2) != 0) + goto error1; + x = (*v1->ob_type->tp_as_number->nb_power)(v1, w2, z2); + DECREF(w2); + DECREF(z2); + error1: + DECREF(v1); + DECREF(z1); + error2: + ; } - x = (*v->ob_type->tp_as_number->nb_power)(v, w, z); DECREF(v); DECREF(w); - if (z!=None) {DECREF(w); DECREF(v); DECREF(z); DECREF(z);} return x; } diff --git a/Python/ceval.c b/Python/ceval.c index 2a3fe7be268..5fa5dbba20a 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/cgensupport.c b/Python/cgensupport.c index 5f3ad047f97..69514673061 100644 --- a/Python/cgensupport.c +++ b/Python/cgensupport.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/compile.c b/Python/compile.c index dbc6314bc1b..a83f9296386 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/errors.c b/Python/errors.c index 9b0a8d28d83..61cb448e71b 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/fmod.c b/Python/fmod.c index 106ad1a3fe8..3ddab75abb1 100644 --- a/Python/fmod.c +++ b/Python/fmod.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/frozenmain.c b/Python/frozenmain.c index 20d0364722a..9be8d5c5a53 100644 --- a/Python/frozenmain.c +++ b/Python/frozenmain.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/getargs.c b/Python/getargs.c index 1232fd0924f..68bfd0e5319 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/getcwd.c b/Python/getcwd.c index 05b58bcd13d..894993faa08 100644 --- a/Python/getcwd.c +++ b/Python/getcwd.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/getmtime.c b/Python/getmtime.c index 7c856106218..f5de0faba56 100644 --- a/Python/getmtime.c +++ b/Python/getmtime.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/import.c b/Python/import.c index a0af0507eef..ef24883ac5e 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/importdl.c b/Python/importdl.c index f377c612bae..f676e3f2df4 100644 --- a/Python/importdl.c +++ b/Python/importdl.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/importdl.h b/Python/importdl.h index c90608e6f89..e56794a1105 100644 --- a/Python/importdl.h +++ b/Python/importdl.h @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/marshal.c b/Python/marshal.c index 48612b094e2..54cabf63e6d 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/memmove.c b/Python/memmove.c index 143e6422d1f..c299d12ba93 100644 --- a/Python/memmove.c +++ b/Python/memmove.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/modsupport.c b/Python/modsupport.c index 2952189f0f8..f196095fff1 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved @@ -58,8 +58,9 @@ initmodule2(name, methods, passthrough) fatal("out of mem for method name"); sprintf(namebuf, "%s.%s", name, ml->ml_name); v = newmethodobject(namebuf, ml->ml_meth, - (object *)passthrough, ml->ml_varargs); - /* XXX The malloc'ed memory in namebuf is never freed */ + (object *)passthrough, + (ml->ml_varargs ? METH_VARARGS : 0) | + METH_FREENAME); if (v == NULL || dictinsert(d, ml->ml_name, v) != 0) { fprintf(stderr, "initializing module: %s\n", name); fatal("can't initialize module"); diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c index 6b2a06ffe7c..10ddc6ec2fc 100644 --- a/Python/mystrtoul.c +++ b/Python/mystrtoul.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/pythonmain.c b/Python/pythonmain.c index 4cf44dc666d..ac9ca2c5b5f 100644 --- a/Python/pythonmain.c +++ b/Python/pythonmain.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/pythonrun.c b/Python/pythonrun.c index f66c8d738ad..c706081c68d 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved @@ -178,12 +178,12 @@ run_tty_1(fp, filename) return -1; d = getmoduledict(m); v = run_node(n, filename, d, d); - flushline(); if (v == NULL) { print_error(); return -1; } DECREF(v); + flushline(); return 0; } @@ -211,12 +211,12 @@ run_script(fp, filename) } else { v = run_file(fp, filename, file_input, d, d); } - flushline(); if (v == NULL) { print_error(); return -1; } DECREF(v); + flushline(); return 0; } @@ -230,12 +230,12 @@ run_command(command) return -1; d = getmoduledict(m); v = run_string(command, file_input, d, d); - flushline(); if (v == NULL) { print_error(); return -1; } DECREF(v); + flushline(); return 0; } @@ -244,6 +244,7 @@ print_error() { object *exception, *v, *tb, *f; err_fetch(&exception, &v, &tb); + flushline(); if (exception == NULL) fatal("print_error called but no exception"); if (exception == SystemExit) { diff --git a/Python/sigcheck.c b/Python/sigcheck.c index 9a5f0db74d1..4a4d11d5993 100644 --- a/Python/sigcheck.c +++ b/Python/sigcheck.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/strerror.c b/Python/strerror.c index d5e0e037a31..3f9438a756d 100644 --- a/Python/strerror.c +++ b/Python/strerror.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/structmember.c b/Python/structmember.c index 7ec48b34102..81a52030ce8 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 4cb16585bc1..ea673639158 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/thread.c b/Python/thread.c index 3ee71aafcee..fb0f6a28516 100644 --- a/Python/thread.c +++ b/Python/thread.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/thread_cthread.h b/Python/thread_cthread.h index bf9a0249ebd..1a1a8608c7a 100644 --- a/Python/thread_cthread.h +++ b/Python/thread_cthread.h @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/thread_foobar.h b/Python/thread_foobar.h index 4b767b1e950..772f26b6f9f 100644 --- a/Python/thread_foobar.h +++ b/Python/thread_foobar.h @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/thread_lwp.h b/Python/thread_lwp.h index ab59ccd274f..a4e943f008f 100644 --- a/Python/thread_lwp.h +++ b/Python/thread_lwp.h @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index c5d7be4d88c..94b918245bc 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/thread_sgi.h b/Python/thread_sgi.h index 489e0ba465f..654d4aec3a6 100644 --- a/Python/thread_sgi.h +++ b/Python/thread_sgi.h @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/thread_solaris.h b/Python/thread_solaris.h index 97be126c5f9..199d7d09d6f 100644 --- a/Python/thread_solaris.h +++ b/Python/thread_solaris.h @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved diff --git a/Python/traceback.c b/Python/traceback.c index 414fc8d26da..bea0b19b57e 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved