summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-07-26 18:07:32 (GMT)
committerGuido van Rossum <guido@python.org>1995-07-26 18:07:32 (GMT)
commita83f270a4ba3a8e3fcc38fa1bdf7f62dd723cfb8 (patch)
tree3d713a2407096a580b89eafe011966e53c7de898 /Objects/classobject.c
parentbebdc376c3aa584bfb9825758d5cf8d5c09c8692 (diff)
downloadcpython-a83f270a4ba3a8e3fcc38fa1bdf7f62dd723cfb8.zip
cpython-a83f270a4ba3a8e3fcc38fa1bdf7f62dd723cfb8.tar.gz
cpython-a83f270a4ba3a8e3fcc38fa1bdf7f62dd723cfb8.tar.bz2
changes for keyword args to built-in functions and classes
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 9870b6e..d4a873f6 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -279,9 +279,10 @@ addaccess(class, inst)
}
object *
-newinstanceobject(class, arg)
+newinstanceobject(class, arg, kw)
object *class;
object *arg;
+ object *kw;
{
register instanceobject *inst;
object *init;
@@ -303,16 +304,16 @@ newinstanceobject(class, arg)
init = instance_getattr1(inst, "__init__");
if (init == NULL) {
err_clear();
- if (arg != NULL && !(is_tupleobject(arg) &&
- gettuplesize(arg) == 0)) {
+ if (arg != NULL && (!is_tupleobject(arg) ||
+ gettuplesize(arg) != 0) || kw != NULL) {
err_setstr(TypeError,
- "this classobject() takes no arguments");
+ "this constructor takes no arguments");
DECREF(inst);
inst = NULL;
}
}
else {
- object *res = call_object(init, arg);
+ object *res = PyEval_CallObjectWithKeywords(init, arg, kw);
DECREF(init);
if (res == NULL) {
DECREF(inst);