From 6d023c98b06e8b4558f3558335433f371a89cc9b Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 4 Jan 1995 19:12:13 +0000 Subject: Added 1995 to copyright message. bltinmodule.c: fixed coerce() nightmare in ternary pow(). modsupport.c (initmodule2): pass METH_FREENAME flag to newmethodobject(). pythonrun.c: move flushline() into and around print_error(). --- Modules/cgensupport.c | 4 ++-- Python/bltinmodule.c | 33 ++++++++++++++++++++++++--------- Python/ceval.c | 4 ++-- Python/cgensupport.c | 4 ++-- Python/compile.c | 4 ++-- Python/errors.c | 4 ++-- Python/fmod.c | 4 ++-- Python/frozenmain.c | 4 ++-- Python/getargs.c | 4 ++-- Python/getcwd.c | 4 ++-- Python/getmtime.c | 4 ++-- Python/import.c | 4 ++-- Python/importdl.c | 4 ++-- Python/importdl.h | 4 ++-- Python/marshal.c | 4 ++-- Python/memmove.c | 4 ++-- Python/modsupport.c | 9 +++++---- Python/mystrtoul.c | 4 ++-- Python/pythonmain.c | 4 ++-- Python/pythonrun.c | 11 ++++++----- Python/sigcheck.c | 4 ++-- Python/strerror.c | 4 ++-- Python/structmember.c | 4 ++-- Python/sysmodule.c | 4 ++-- Python/thread.c | 4 ++-- Python/thread_cthread.h | 4 ++-- Python/thread_foobar.h | 4 ++-- Python/thread_lwp.h | 4 ++-- Python/thread_pthread.h | 4 ++-- Python/thread_sgi.h | 4 ++-- Python/thread_solaris.h | 4 ++-- Python/traceback.c | 4 ++-- 32 files changed, 93 insertions(+), 76 deletions(-) diff --git a/Modules/cgensupport.c b/Modules/cgensupport.c index 5f3ad04..6951467 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 39dcc41..c553be6 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 2a3fe7b..5fa5dbb 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 5f3ad04..6951467 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 dbc6314..a83f929 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 9b0a8d2..61cb448 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 106ad1a..3ddab75 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 20d0364..9be8d5c 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 1232fd0..68bfd0e 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 05b58bc..894993f 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 7c85610..f5de0fa 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 a0af050..ef24883 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 f377c61..f676e3f 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 c90608e..e56794a 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 48612b0..54cabf6 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 143e642..c299d12 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 2952189..f196095 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 6b2a06f..10ddc6e 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 4cf44dc..ac9ca2c 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 f66c8d7..c706081 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 9a5f0db..4a4d11d 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 d5e0e03..3f9438a 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 7ec48b3..81a5203 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 4cb1658..ea67363 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 3ee71aa..fb0f6a2 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 bf9a024..1a1a860 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 4b767b1..772f26b 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 ab59ccd..a4e943f 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 c5d7be4..94b9182 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 489e0ba..654d4ae 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 97be126..199d7d0 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 414fc8d..bea0b19 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 -- cgit v0.12