Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Split from PR 958: restoring the __import__ after shutdown.#993

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

benoithudson
Copy link
Contributor

@benoithudsonbenoithudson commentedNov 21, 2019
edited
Loading

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 toAUTHORS
  • Updated theCHANGELOG

When C# shuts down we should restore Python to its original state.
@codecov-io
Copy link

codecov-io commentedNov 21, 2019
edited
Loading

Codecov Report

Merging#993 intomaster willnot change coverage.
The diff coverage isn/a.

Impacted file tree graph

@@           Coverage Diff           @@##           master     #993   +/-   ##=======================================  Coverage   86.71%   86.71%           =======================================  Files           1        1             Lines         301      301           =======================================  Hits          261      261             Misses         40       40
FlagCoverage Δ
#setup_linux65.44% <ø> (ø)⬆️
#setup_windows71.42% <ø> (ø)⬆️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update2736094...668c590. Read thecomment docs.

@filmorfilmor merged commit5f2e2e2 intopythonnet:masterNov 21, 2019
@filmor
Copy link
Member

Nice, thank you very much :)

@benoithudsonbenoithudson deleted the 958-import-hook branchNovember 21, 2019 15:41
@benoithudsonbenoithudson mentioned this pull requestNov 21, 2019
4 tasks
AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this pull requestJun 27, 2020
…t#993)When C# shuts down we should restore Python to its original state.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@benoithudson@codecov-io@filmor

[8]ページ先頭

©2009-2025 Movatter.jp