Skip to content

Commit

Permalink
Fix double conversion of Scheme procedures.
Browse files Browse the repository at this point in the history
The `procedure->PyObject*/function` procedure already converts its
argumetn (`proc`) into a `SchemeObject`. We must not do it again in `python-SchemeProcedure`.
  • Loading branch information
belmarca committed Jan 11, 2023
1 parent 3a8456b commit a0805f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a0805f7

Please sign in to comment.