diff options
author | Guido van Rossum <guido@python.org> | 1996-10-21 15:12:32 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-10-21 15:12:32 (GMT) |
commit | 8bcf369cf9890ef7cfeb6f199d46932b7c249662 (patch) | |
tree | 9953129b6662e5cecf31723f257e72cdb8c6c335 /Objects/classobject.c | |
parent | 1d6fddb77664c39906df850250fe0298c3804f58 (diff) | |
download | cpython-8bcf369cf9890ef7cfeb6f199d46932b7c249662.zip cpython-8bcf369cf9890ef7cfeb6f199d46932b7c249662.tar.gz cpython-8bcf369cf9890ef7cfeb6f199d46932b7c249662.tar.bz2 |
Support passing in an empty dictionary of keywords to newinstanceobject.
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index 4ac6a0e..f392fae 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -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); |