Kaydet (Commit) 8bcf369c authored tarafından Guido van Rossum's avatar Guido van Rossum

Support passing in an empty dictionary of keywords to newinstanceobject.

üst 1d6fddb7
...@@ -347,7 +347,9 @@ newinstanceobject(class, arg, kw) ...@@ -347,7 +347,9 @@ newinstanceobject(class, arg, kw)
if (init == NULL) { if (init == NULL) {
err_clear(); err_clear();
if (arg != NULL && (!is_tupleobject(arg) || 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, err_setstr(TypeError,
"this constructor takes no arguments"); "this constructor takes no arguments");
DECREF(inst); DECREF(inst);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment