diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-06-16 07:07:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-16 07:07:30 -0700 |
| commit | 5c10c365fef3ca480c930cb379bf1d0ebadcd911 (patch) | |
| tree | c9b50f98eb7d6e7c1fea6f04ae67a1cceb0578c1 /Lib/doctest.py | |
| parent | b62d37c4a5016b3239c72c147de7f04a9be66e02 (diff) | |
| download | cpython-git-5c10c365fef3ca480c930cb379bf1d0ebadcd911.tar.gz | |
gh-91577: SharedMemory move imports out of methods (GH-91579)
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 commit 9a458befdd68625d088f4fea7df135a57d147deb)
Co-authored-by: samtygier <samtygier@yahoo.co.uk>
Diffstat (limited to 'Lib/doctest.py')
0 files changed, 0 insertions, 0 deletions
