summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-17 21:12:06 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-17 21:12:06 (GMT)
commite9fd28dae50d5e91c7e62e295b1de484c2c56746 (patch)
tree8491a89a56e6747c13832183a0b869796635ce4f
parent792fd435ecc68de9c85e4f2b28fb28425dc1bd8e (diff)
downloadcpython-e9fd28dae50d5e91c7e62e295b1de484c2c56746.zip
cpython-e9fd28dae50d5e91c7e62e295b1de484c2c56746.tar.gz
cpython-e9fd28dae50d5e91c7e62e295b1de484c2c56746.tar.bz2
Add stacksize argument to new.code().
-rw-r--r--Lib/test/test_new.py2
-rw-r--r--Modules/newmodule.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/test_new.py b/Lib/test/test_new.py
index 887702d..628d8ef 100644
--- a/Lib/test/test_new.py
+++ b/Lib/test/test_new.py
@@ -58,6 +58,6 @@ if g['c'] <> 3:
# bogus test of new.code()
print 'new.code()'
-d = new.code(3, 3, 3, codestr, (), (), (), "<string>", "<name>")
+d = new.code(3, 3, 3, 3, codestr, (), (), (), "<string>", "<name>")
if verbose:
print d
diff --git a/Modules/newmodule.c b/Modules/newmodule.c
index f012e64..6d7b34f 100644
--- a/Modules/newmodule.c
+++ b/Modules/newmodule.c
@@ -119,7 +119,7 @@ new_function(unused, args)
}
static char new_code_doc[] =
-"Create a code object from (ARGCOUNT, NLOCALS, FLAGS, CODESTRING, CONSTANTS, NAMES, VARNAMES, FILENAME, NAME).";
+"Create a code object from (ARGCOUNT, NLOCALS, STACKSIZE, FLAGS, CODESTRING, CONSTANTS, NAMES, VARNAMES, FILENAME, NAME).";
static PyObject *
new_code(unused, args)
@@ -128,6 +128,7 @@ new_code(unused, args)
{
int argcount;
int nlocals;
+ int stacksize;
int flags;
PyObject* code;
PyObject* consts;
@@ -136,15 +137,15 @@ new_code(unused, args)
PyObject* filename;
PyObject* name;
- if (!PyArg_ParseTuple(args, "iiiSO!O!O!SS",
- &argcount, &nlocals, &flags, /* These are new */
+ if (!PyArg_ParseTuple(args, "iiiiSO!O!O!SS",
+ &argcount, &nlocals, &stacksize, &flags,
&code,
&PyTuple_Type, &consts,
&PyTuple_Type, &names,
- &PyTuple_Type, &varnames, /* These are new */
+ &PyTuple_Type, &varnames,
&filename, &name))
return NULL;
- return (PyObject *)PyCode_New(argcount, nlocals, flags,
+ return (PyObject *)PyCode_New(argcount, nlocals, stacksize, flags,
code, consts, names, varnames,
filename, name);
}