cpython: Small cleanup
http://hg.python.org/cpython/rev/d72e04ff0f97 changeset: 71667:d72e04ff0f97 user: Éric Araujo <merwok@netwok.org> date: Sun Jul 31 18:41:25 2011 +0200 summary: Small cleanup files: Tools/scripts/patchcheck.py | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -39,18 +39,13 @@ @status("Getting the list of files that have been added/changed", info=lambda x: n_files_str(len(x))) def changed_files(): - """Get the list of changed or added files from the VCS.""" - if os.path.isdir(os.path.join(SRCDIR, '.hg')): - cmd = 'hg status --added --modified --no-status' - else: + """Get the list of changed or added files from Mercurial.""" + if not os.path.isdir(os.path.join(SRCDIR, '.hg')): sys.exit('need a checkout to get modified files') - st = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) - try: - st.wait() + cmd = 'hg status --added --modified --no-status' + with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st: return [x.decode().rstrip() for x in st.stdout] - finally: - st.stdout.close() def report_modified_files(file_paths): -- Repository URL: http://hg.python.org/cpython
participants (1)
-
eric.araujo