From acc8ab802fd9ef22f182a33997f50ad56da9ab6e Mon Sep 17 00:00:00 2001 From: BLUELOVETH Date: Thu, 1 Jun 2023 19:23:56 +0800 Subject: [PATCH] ... --- src/vm.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/vm.h b/src/vm.h index 32fc1d80..eadf283b 100644 --- a/src/vm.h +++ b/src/vm.h @@ -1423,9 +1423,6 @@ inline void VM::setattr(PyObject* obj, StrName name, PyObject* value){ template PyObject* VM::bind_method(PyObject* obj, Str name, NativeFuncC fn) { check_non_tagged_type(obj, tp_type); - if(obj->attr().contains(name)){ - throw std::runtime_error(fmt("bind_method() failed: ", name.escape(), " already exists")); - } PyObject* nf = VAR(NativeFunc(fn, ARGC, true)); obj->attr().set(name, nf); return nf; @@ -1433,9 +1430,6 @@ PyObject* VM::bind_method(PyObject* obj, Str name, NativeFuncC fn) { template PyObject* VM::bind_func(PyObject* obj, Str name, NativeFuncC fn) { - if(obj->attr().contains(name)){ - throw std::runtime_error(fmt("bind_func() failed: ", name.escape(), " already exists")); - } PyObject* nf = VAR(NativeFunc(fn, ARGC, false)); obj->attr().set(name, nf); return nf;