Split from PR 958: restoring the __import__ after shutdown. by benoithudson · Pull Request #993 · pythonnet/pythonnet
Repository navigation
Split from PR 958: restoring the __import__ after shutdown. - #993
Merged
filmor merged 1 commit into pythonnet:master from Unity-Technologies:958-import-hook Nov 21, 2019
Merged
Split from PR 958: restoring the __import__ after shutdown. #993 filmor merged 1 commit into pythonnet:master from Unity-Technologies:958-import-hook
Conversation
benoithudson commented Nov 21, 2019 · edited Loading
Copy link Copy Markdown
Contributor
When C# shuts down we should restore Python to its original state.
What does this implement/fix? Explain your changes.
This is adapted from the large patch that amos put in PR #958 . It restores the import hook.
Does this close any currently open issues?
Not yet.
Any other comments?
I would have used the ShutdownHandler but that's only in the PythonEngine, whereas __import__ is in the Runtime. Maybe we should move the ShutdownHandler mechanism to the runtime?
Checklist
Check all those that are applicable and complete.
- Make sure to include one or more tests for your change
Can't really test this at the moment. After Py_Finalize (in Shutdown), we can't check the state of the __import__ function until we call Py_Initialize. But Py_Initialize will create a new __import__, so we can't see whether our code ran. This change only becomes relevant when we stop calling Py_Finalize in Shutdown.
- If an enhancement PR, please create docs and at best an example
- Add yourself to
AUTHORS - Updated the
CHANGELOG
Split from PR 958: restoring the __import__ after shutdown.
668c590
When C# shuts down we should restore Python to its original state.
codecov-io commented Nov 21, 2019 · edited Loading
Copy link Copy Markdown
Codecov Report
@@ Coverage Diff @@ ## master #993 +/- ## ======================================= Coverage 86.71% 86.71% ======================================= Files 1 1 Lines 301 301 ======================================= Hits 261 261 Misses 40 40
Continue to review full report at Codecov .
|
5f2e2e2
into
pythonnet : master
Nov 21, 2019
filmor commented Nov 21, 2019
Copy link Copy Markdown
Member
|
Nice, thank you very much :) |
Split from PR 958: restoring the __import__ after shutdown. (pythonne...
4e4b41c
...t#993) When C# shuts down we should restore Python to its original state.Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment