-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finalize Python runtime while shutting down Julia #603
Conversation
src/PyCall.jl
Outdated
@@ -98,9 +98,11 @@ it is equivalent to a `PyNULL()` object. | |||
""" | |||
ispynull(o::PyObject) = o.o == PyPtr_NULL | |||
|
|||
function pydecref_(o::Union{PyPtr,PyObject}) | |||
function pydecref_(o::Union{PyPtr,PyObject}) :: Nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use the return value anywhere. So why not return nothing
always?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems better to return something potentially useful (o
), so that the result can be chained with some other function. Also, this way it mirrors pyincref
. Why not just return o
always?
There is a segfault in Julia 0.7... https://travis-ci.org/JuliaPy/PyCall.jl/jobs/447533492#L767 |
...which is apparently solved by going to non-closure (non- |
Re #603 (comment): I changed the return type of |
Basically icorporates changes introduced in JuliaPy#603
* Fix Segfault during finalization Basically icorporates changes introduced in #603 * Fix typo
While resolving merge conflicts for #517, I found that the "atexit" tests from this PR are failing due to me having a |
How does your startup.jl file affect the test? |
It failed because it couldn't find out = read(`$(Base.julia_cmd()) -e $script`, String) doesn't take care of setting the currently used environment. |
I should have used |
Should I simply fix it in #517? |
I'd appreciate if you do it. |
Done. |
closes JuliaPy/pyjulia#208
It's a bit scary to play with the shutdown process of two GCs. But it seems to work in simple tests...