mirror of
https://github.com/exaloop/codon.git
synced 2025-06-03 15:03:52 +08:00
Fix argument check
This commit is contained in:
parent
e4edf2273f
commit
95f28e11a6
@ -342,7 +342,7 @@ def init_dl_handles(py_handle: cobj):
|
||||
Py_None = dlsym(py_handle, "_Py_NoneStruct")
|
||||
Py_True = dlsym(py_handle, "_Py_TrueStruct")
|
||||
Py_False = dlsym(py_handle, "_Py_FalseStruct")
|
||||
PyExc_TypeError = dlsym(py_handle, "PyExc_TypeError")
|
||||
PyExc_TypeError = Ptr[cobj](dlsym(py_handle, "PyExc_TypeError"))[0]
|
||||
|
||||
def setup_python(python_loaded: bool):
|
||||
global _PY_INITIALIZED
|
||||
@ -718,7 +718,7 @@ def _isinstance(what: pyobj, typ: pyobj) -> bool:
|
||||
def _extension_bad_args(got: int, expected: int) -> bool:
|
||||
if got != expected:
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
f"expected {expected} arguments, but got {got}".c_str());
|
||||
f"expected {expected} arguments, but got {got}".c_str())
|
||||
return True
|
||||
return False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user