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

[3.10] gh-91577: SharedMemory move imports out of methods (GH-91579)#93905

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

@miss-islington
Copy link
Contributor

SharedMemory.unlink() uses the unregister() function from resource_tracker. Previously it was imported in the method, but this can fail if the method is called during interpreter shutdown, for example when unlink is part of adel() method.

Moving the import to the top of the file, means that the unregister() method is available during interpreter shutdown.

The register call in SharedMemory.init() can also use this imported resource_tracker.
(cherry picked from commit9a458be)

Co-authored-by: samtygiersamtygier@yahoo.co.uk

)SharedMemory.unlink() uses the unregister() function from resource_tracker. Previously it was imported in the method, but this can fail if the method is called during interpreter shutdown, for example when unlink is part of a __del__() method.Moving the import to the top of the file, means that the unregister() method is available during interpreter shutdown.The register call in SharedMemory.__init__() can also use this imported resource_tracker.(cherry picked from commit9a458be)Co-authored-by: samtygier <samtygier@yahoo.co.uk>
@miss-islington
Copy link
ContributorAuthor

Status check is done, and it's a success ✅ .

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM, good bot.

@miss-islington
Copy link
ContributorAuthor

Status check is done, and it's a success ✅ .

@miss-islingtonmiss-islington merged commit5c10c36 intopython:3.10Jun 16, 2022
@miss-islingtonmiss-islington deleted the backport-9a458be-3.10 branchJune 16, 2022 14:07
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner approved these changes

@tirantiranAwaiting requested review from tirantiran is a code owner

Assignees

No one assigned

Labels

type-bugAn unexpected behavior, bug, or error

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@miss-islington@vstinner@bedevere-bot@samtygier

[8]ページ先頭

©2009-2025 Movatter.jp