diff Python/modsupport.c @ 2062:d0d0a69b5ca3 legacy-trunk

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().
author Guido van Rossum <guido@python.org>
date Wed, 04 Jan 1995 19:12:13 +0000
parents d7e91437f0a2
children f78b387b54e0
line wrap: on
line diff
--- a/Python/modsupport.c	Wed Jan 04 19:10:35 1995 +0000
+++ b/Python/modsupport.c	Wed Jan 04 19:12:13 1995 +0000
@@ -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 @@
 			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");