From: Guido van Rossum Date: Wed, 4 Jan 1995 19:12:13 +0000 (+0000) Subject: Added 1995 to copyright message. X-Git-Tag: v1.2b1~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d023c98b06e8b4558f3558335433f371a89cc9b;p=thirdparty%2FPython%2Fcpython.git 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(). --- diff --git a/Modules/cgensupport.c b/Modules/cgensupport.c index 5f3ad047f97e..69514673061d 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 39dcc411b2ff..c553be60aa00 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 2a3fe7be2686..5fa5dbba20a8 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 5f3ad047f97e..69514673061d 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 dbc6314bc1ba..a83f9296386d 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 9b0a8d28d836..61cb448e71be 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 106ad1a3fe8e..3ddab75abb16 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 20d0364722a3..9be8d5c5a530 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 1232fd0924f6..68bfd0e53190 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 05b58bcd13df..894993faa082 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 7c8561062185..f5de0faba568 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 a0af0507eef3..ef24883ac5ed 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 f377c612baeb..f676e3f2df41 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 c90608e6f890..e56794a11056 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 48612b094e22..54cabf63e6d9 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 143e6422d1fd..c299d12ba933 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 2952189f0f81..f196095fff17 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 6b2a06ffe7c4..10ddc6ec2fca 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 4cf44dc666d2..ac9ca2c5b5fb 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 f66c8d738ad0..c706081c68d3 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 9a5f0db74d16..4a4d11d59938 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 d5e0e037a31e..3f9438a756d4 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 7ec48b341023..81a52030ce8e 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 4cb16585bc1b..ea673639158a 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 3ee71aafcee2..fb0f6a285164 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 bf9a0249ebd2..1a1a8608c7a5 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 4b767b1e9508..772f26b6f9f2 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 ab59ccd274f2..a4e943f008f4 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 c5d7be4d88c7..94b918245bcf 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 489e0ba465fd..654d4aec3a6c 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 97be126c5f90..199d7d09d6f9 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 414fc8d26daa..bea0b19b57e7 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