]> granicus.if.org Git - python/commitdiff
Support passing in an empty dictionary of keywords to newinstanceobject.
authorGuido van Rossum <guido@python.org>
Mon, 21 Oct 1996 15:12:32 +0000 (15:12 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 21 Oct 1996 15:12:32 +0000 (15:12 +0000)
Objects/classobject.c

index 4ac6a0eff6b3b7cb17a1e75b894eb68a00ba6537..f392fae13fca98c6cd77d38396aee1d5f3e64310 100644 (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);