]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use context managers as suggested by PyLint 2.8.2
authorMichał Kępień <michal@isc.org>
Tue, 18 May 2021 08:53:17 +0000 (10:53 +0200)
committerMichał Kępień <michal@isc.org>
Tue, 18 May 2021 08:53:17 +0000 (10:53 +0200)
commita8163551edfd9f48b1b7b596d988b3d7afbefef0
treea27ada118fc9c5d0c36b6da35d4e12d224456029
parent71284cb4965d1dbd9a686ef0c8e6ef0b7c662549
Use context managers as suggested by PyLint 2.8.2

PyLint 2.8.2 reports the following suggestions for two Python scripts
used in the system test suite:

    ************* Module tests_rndc_deadlock
    bin/tests/system/addzone/tests_rndc_deadlock.py:71:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    ************* Module tests-shutdown
    bin/tests/system/shutdown/tests-shutdown.py:68:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    bin/tests/system/shutdown/tests-shutdown.py:154:8: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)

Implement the above suggestions by using
concurrent.futures.ThreadPoolExecutor() and subprocess.Popen() as
context managers.
bin/tests/system/addzone/tests_rndc_deadlock.py
bin/tests/system/shutdown/tests-shutdown.py