summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-10-21 15:12:32 (GMT)
committerGuido van Rossum <guido@python.org>1996-10-21 15:12:32 (GMT)
commit8bcf369cf9890ef7cfeb6f199d46932b7c249662 (patch)
tree9953129b6662e5cecf31723f257e72cdb8c6c335 /Objects
parent1d6fddb77664c39906df850250fe0298c3804f58 (diff)
downloadcpython-8bcf369cf9890ef7cfeb6f199d46932b7c249662.zip
cpython-8bcf369cf9890ef7cfeb6f199d46932b7c249662.tar.gz
cpython-8bcf369cf9890ef7cfeb6f199d46932b7c249662.tar.bz2
Support passing in an empty dictionary of keywords to newinstanceobject.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/classobject.c4
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);