mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-05-07 13:08:07 +02:00
main: Follow pylint recommendation and use "with"
src/powerprofilesctl:185:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) Closes: #35
This commit is contained in:
parent
417c830355
commit
42b3341b29
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue