Catch extraneous kwargs in __new__ with default __init__
This commit is contained in:
parent
011a33ff43
commit
85319d7f27
@ -203,7 +203,7 @@ KRK_StaticMethod(object,__new__) {
|
||||
_cls = _cls->base;
|
||||
}
|
||||
|
||||
if (_argc && _class->_init == vm.baseClasses->objectClass->_init) {
|
||||
if (_class->_init == vm.baseClasses->objectClass->_init && (_argc || (hasKw && AS_DICT(argv[argc])->count))) {
|
||||
return krk_runtimeError(vm.exceptions->typeError, "%S() takes no arguments", _class->name);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user