Support passing in an empty dictionary of keywords to newinstanceobject.

This commit is contained in:
Guido van Rossum 1996-10-21 15:12:32 +00:00
parent 1d6fddb776
commit 8bcf369cf9

View file

@ -347,7 +347,9 @@ newinstanceobject(class, arg, kw)
if (init == NULL) {
err_clear();
if (arg != NULL && (!is_tupleobject(arg) ||
gettuplesize(arg) != 0) || kw != NULL) {
gettuplesize(arg) != 0)
|| kw != NULL && (!is_dictobject(kw) ||
getdictsize(kw) != 0)) {
err_setstr(TypeError,
"this constructor takes no arguments");
DECREF(inst);