Skip to content

Use context managers with preferences lock.#306

Merged
mdickinson merged 4 commits into
mainfrom
enh/modernize-locking
Aug 15, 2022
Merged

Use context managers with preferences lock.#306
mdickinson merged 4 commits into
mainfrom
enh/modernize-locking

Conversation

@corranwebster
Copy link
Copy Markdown
Contributor

@corranwebster corranwebster commented May 14, 2022

A drive-by code modernization to replace acquire()/release() pairs with the safer use of a context manager.

Includes a drive-by modernization of the super() statement.

Should be no change to behaviour except if something goes wrong, and then it will now do the right thing and release the lock.

Checklist

  • Add a news fragment if this PR is news-worthy for end users. (see docs/releases/README.rst)

Simple code modernization to replace acquire()/release() pairs with the safer use of a context manager.

Includes a drive-by modernization of the super() statement.
@corranwebster
Copy link
Copy Markdown
Contributor Author

Needs #307 for flake8 to pass.

Copy link
Copy Markdown
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

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

LGTM

@mdickinson mdickinson merged commit b61c46c into main Aug 15, 2022
@mdickinson mdickinson deleted the enh/modernize-locking branch August 15, 2022 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants