From a0805f7f5e1d17fa698bb945a4b638e3a79d5a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20B=C3=A9langer?= Date: Wed, 11 Jan 2023 12:37:35 -0500 Subject: [PATCH] Fix double conversion of Scheme procedures. The `procedure->PyObject*/function` procedure already converts its argumetn (`proc`) into a `SchemeObject`. We must not do it again in `python-SchemeProcedure`. --- python.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python.scm b/python.scm index 339b5a4..412180a 100644 --- a/python.scm +++ b/python.scm @@ -3052,10 +3052,12 @@ end-of-c-declare (define python-exec (sfpc-send-recv (get-scheme-fpc-state!) (vector op-get-exec))) +;; Create a _SchemeProcedure instance. +;; obj is a SchemeObject that contains a pointer to a Scheme function. (define python-SchemeProcedure (let ((_SchemeProcedure (python-eval "foreign(_SchemeProcedure)"))) (lambda (obj) - (PyObject_CallFunctionObjArgs1 _SchemeProcedure (object->SchemeObject obj))))) + (PyObject_CallFunctionObjArgs1 _SchemeProcedure obj)))) ((python-eval "__import__('sys').path.append") (path-expand "site-packages" python-venv-lib-dir))