diff options
author | Éric Araujo <merwok@netwok.org> | 2011-07-31 16:41:25 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-07-31 16:41:25 (GMT) |
commit | 56ec5fe950da9903ec9fc614e8d0a9b4b7f6f95f (patch) | |
tree | 9b3b56ecb40ad62bae160b19d41f594f2a5047a9 /Tools | |
parent | ad548b8534645ebb7590eb557c04d86814bde203 (diff) | |
download | cpython-56ec5fe950da9903ec9fc614e8d0a9b4b7f6f95f.zip cpython-56ec5fe950da9903ec9fc614e8d0a9b4b7f6f95f.tar.gz cpython-56ec5fe950da9903ec9fc614e8d0a9b4b7f6f95f.tar.bz2 |
Small cleanup
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/patchcheck.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index b01f77c..204407e 100755 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -39,18 +39,13 @@ def status(message, modal=False, info=None): @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): |