Skip to content

Fix crash#44

Merged
pvieito merged 4 commits into
pvieito:masterfrom
philipturner:patch-4
Jan 21, 2022
Merged

Fix crash#44
pvieito merged 4 commits into
pvieito:masterfrom
philipturner:patch-4

Conversation

@philipturner

Copy link
Copy Markdown
Contributor

When I set Python to use 3.9 instead of 3.10, it crashes upon materializing a PythonFunction's object. The culprit is the PyCFunction_New function, as documented in clj-python/libpython-clj#105. We can work around this by calling PyCFunction_NewEx and passing nil into the last parameter. This workaround should stay permanent because people might use Python 3.9 in the future.

@pvieito

pvieito commented Jan 21, 2022

Copy link
Copy Markdown
Owner

@philipturner Hi! Could you add some tests for PythonFunction?

@philipturner

Copy link
Copy Markdown
Contributor Author

I added a test. I really only think one test is necessary because we're just ensuring the crash doesn't happen. Tests for subclassing will test PythonFunction functionality more thoroughly anyway.

@philipturner

philipturner commented Jan 21, 2022

Copy link
Copy Markdown
Contributor Author

@pvieito how do we fix the CI issue on Windows?

Update: The CI issue seems to be fixed. Can you be sure it's not something flaky?

@pvieito pvieito merged commit e531f3a into pvieito:master Jan 21, 2022
bwbemb pushed a commit to bwbemb/PythonKit that referenced this pull request Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants