From 42b3341b29047489ea5eecaf8cf7d6e74a228891 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 5 Aug 2021 15:58:24 +0200 Subject: [PATCH] main: Follow pylint recommendation and use "with" src/powerprofilesctl:185:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) Closes: #35 --- src/powerprofilesctl.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/powerprofilesctl.in b/src/powerprofilesctl.in index fdbf60d..2b81258 100755 --- a/src/powerprofilesctl.in +++ b/src/powerprofilesctl.in @@ -182,8 +182,8 @@ def _launch(args, profile, appid, reason): signal.signal(signal.SIGTERM, receive_signal) # print (f'Got {cookie} for {profile} hold') - launched_app = subprocess.Popen(args) - launched_app.wait() + with subprocess.Popen(args) as launched_app: + launched_app.wait() proxy.ReleaseProfile('(u)', cookie) def main(): # pylint: disable=too-many-branches, disable=too-many-statements