From 95f28e11a68fee347231d6cbd0c5978028d037c1 Mon Sep 17 00:00:00 2001 From: "A. R. Shajii" Date: Sun, 29 Jan 2023 22:10:22 -0500 Subject: [PATCH] Fix argument check --- stdlib/internal/python.codon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/internal/python.codon b/stdlib/internal/python.codon index 676698e0..58755839 100644 --- a/stdlib/internal/python.codon +++ b/stdlib/internal/python.codon @@ -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