]> git.ipfire.org Git - thirdparty/dnspython.git/commit
Use context managers to simplify code. 461/head
authorBrian Wellington <bwelling@xbill.org>
Sat, 2 May 2020 00:20:21 +0000 (17:20 -0700)
committerBrian Wellington <bwelling@xbill.org>
Sat, 2 May 2020 00:20:21 +0000 (17:20 -0700)
commit279f7b788b98e193bb8fcd2b6aaed1d57ce2c29b
tree6e15d63609b006836cfdf10300ea7b904084a75b
parent896b0ae5f38b5ea349558bcee419e49b31974102
Use context managers to simplify code.

Simplify code using try/finally to use context managers.

In some cases, contextlib.ExitStack() is used; this could probably be
further simplified to use contextlib.nullcontext() once Python 3.7+ is a
requirement.
dns/entropy.py
dns/message.py
dns/query.py
dns/resolver.py
dns/zone.py