mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix resource warning from patchcheck.py
This commit is contained in:
parent
28053fb174
commit
1e600dc01f
1 changed files with 9 additions and 6 deletions
|
@ -45,13 +45,16 @@ 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)
|
||||||
st.wait()
|
try:
|
||||||
if vcs == 'hg':
|
st.wait()
|
||||||
return [x.decode().rstrip() for x in st.stdout]
|
if vcs == 'hg':
|
||||||
else:
|
return [x.decode().rstrip() for x in st.stdout]
|
||||||
output = (x.decode().rstrip().rsplit(None, 1)[-1]
|
else:
|
||||||
for x in st.stdout if x[0] in b'AM')
|
output = (x.decode().rstrip().rsplit(None, 1)[-1]
|
||||||
|
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):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue