Browse Source

newsunpack -> run_simple(): solves ResourceWarning: unclosed file on Popen()

pull/1408/head
Sander Jonkers 5 years ago
committed by Safihre
parent
commit
e71bd8370d
  1. 6
      sabnzbd/newsunpack.py

6
sabnzbd/newsunpack.py

@ -2406,7 +2406,7 @@ class SevenZip:
def run_simple(cmd): def run_simple(cmd):
""" Run simple external command and return output """ """ Run simple external command and return output """
p = Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) with Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p:
txt = platform_btou(p.stdout.read()) txt = platform_btou(p.stdout.read())
p.wait() p.wait()
return txt return txt

Loading…
Cancel
Save