Skip to content
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

gh-91577: SharedMemory move imports out of methods #91579

Merged
merged 1 commit into from
Jun 16, 2022

Commits on Jun 16, 2022

  1. pythongh-91577: SharedMemory move imports out of methods

    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.
    samtygier committed Jun 16, 2022
    Configuration menu
    Copy the full SHA
    296ddaa View commit details
    Browse the repository at this point in the history