Kaydet (Commit) 1e600dc0 authored tarafından Éric Araujo's avatar Éric Araujo

Fix resource warning from patchcheck.py

üst 28053fb1
...@@ -45,6 +45,7 @@ def changed_files(): ...@@ -45,6 +45,7 @@ def changed_files():
sys.exit('need a checkout to get modified files') sys.exit('need a checkout to get modified files')
st = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) st = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
try:
st.wait() st.wait()
if vcs == 'hg': if vcs == 'hg':
return [x.decode().rstrip() for x in st.stdout] return [x.decode().rstrip() for x in st.stdout]
...@@ -52,6 +53,8 @@ def changed_files(): ...@@ -52,6 +53,8 @@ def changed_files():
output = (x.decode().rstrip().rsplit(None, 1)[-1] output = (x.decode().rstrip().rsplit(None, 1)[-1]
for x in st.stdout if x[0] in b'AM') for x in st.stdout if x[0] in b'AM')
return set(path for path in output if os.path.isfile(path)) return set(path for path in output if os.path.isfile(path))
finally:
st.stdout.close()
def report_modified_files(file_paths): def report_modified_files(file_paths):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment