Compare commits

..

No commits in common. "b1ffa191d2ac1ebf9ca3b014da2d7ced4a4cff2d" and "1d319c4ab67063ca19d02c9012d16b7a2c4ba1d8" have entirely different histories.

4 changed files with 3 additions and 24 deletions

View File

@ -468,7 +468,7 @@ PK_EXPORT bool KeyError(py_Ref key) PY_RAISE;
/// Python equivalent to `bool(val)`.
/// 1: true, 0: false, -1: error
PK_EXPORT int py_bool(py_Ref val) PY_RAISE;
PK_EXPORT int py_bool(py_Ref val) PY_RAISE PY_RETURN;
/// Compare two objects.
/// 1: lhs == rhs, 0: lhs != rhs, -1: error
@ -598,7 +598,7 @@ enum py_PredefinedTypes {
tp_nativefunc,
tp_boundmethod,
tp_super, // 1 slot + py_Type
tp_BaseException, // 2 slots (arg + inner_exc)
tp_BaseException, // 2 slots (arg + inner exc)
tp_Exception,
tp_bytes,
tp_namedict,

View File

@ -486,10 +486,6 @@ FrameResult VM__vectorcall(VM* self, uint16_t argc, uint16_t kwargc, bool opcall
}
if(p0->type == tp_nativefunc) {
if(kwargc) {
TypeError("nativefunc does not accept keyword arguments");
return RES_ERROR;
}
bool ok = py_callcfunc(p0->_cfunc, p1 - argv, argv);
self->stack.sp = p0;
return ok ? RES_RETURN : RES_ERROR;

View File

@ -99,18 +99,6 @@ static bool _py_BaseException__str__(int argc, py_Ref argv) {
return true;
}
static bool BaseException_args(int argc, py_Ref argv){
PY_CHECK_ARGC(1);
py_Ref arg = py_getslot(argv, 0);
if(!py_isnil(arg)) {
py_newtuple(py_retval(), 1);
py_setslot(py_retval(), 0, arg);
}else{
py_newtuple(py_retval(), 0);
}
return true;
}
py_Type pk_BaseException__register() {
py_Type type = pk_newtype("BaseException", tp_object, NULL, BaseException__dtor, false, false);
@ -118,7 +106,6 @@ py_Type pk_BaseException__register() {
py_bindmagic(type, __init__, _py_BaseException__init__);
py_bindmagic(type, __repr__, _py_BaseException__repr__);
py_bindmagic(type, __str__, _py_BaseException__str__);
py_bindproperty(type, "args", BaseException_args, NULL);
return type;
}

View File

@ -272,11 +272,7 @@ static bool str_join(int argc, py_Ref argv) {
bool first = true;
while(true) {
int res = py_next(py_peek(-1));
if(res == -1) {
c11_sbuf__dtor(&buf);
return false;
}
if(res == -1) return false;
if(res == 0) break;
if(!first) c11_sbuf__write_sv(&buf, self);