diff options
author | Ben Brown <ben@demerara.io> | 2021-11-18 18:38:15 +0000 |
---|---|---|
committer | Ben Brown <ben@demerara.io> | 2021-11-18 18:38:15 +0000 |
commit | 45941ff31b113383c1cb52129720f76b19bb287f (patch) | |
tree | 4d829749b7b12b677c4bd97face102d96005ee84 | |
parent | b3aad98e366fbf3b07c80b15a6638a84ca9c2af9 (diff) | |
download | lorry-45941ff31b113383c1cb52129720f76b19bb287f.tar.gz |
Modify raw-file importer to work with python 3.6
-rwxr-xr-x | lorry.raw-file-importer | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lorry.raw-file-importer b/lorry.raw-file-importer index bca46b5..caaa8c9 100755 --- a/lorry.raw-file-importer +++ b/lorry.raw-file-importer @@ -39,7 +39,11 @@ def commit_lfs_gitattributes(fast_import): def commit_lfs_file(raw_file, relative_path, last_commit, fast_import): # git-lfs-pointer of the file - ret = subprocess.run(['git', 'lfs', 'pointer', '--file', raw_file], capture_output=True, check=True) + ret = subprocess.run( + ['git', 'lfs', 'pointer', '--file', raw_file], + stdout=subprocess.PIPE, + check=True, + ) pointer_digest = ret.stdout datasize = len(pointer_digest) @@ -86,7 +90,11 @@ def commit_lfs_file(raw_file, relative_path, last_commit, fast_import): def get_last_commit(): # show the full hash of the latest commit - out = subprocess.run(['git', 'rev-parse', branch_ref], capture_output=True, text=True) + out = subprocess.run( + ['git', 'rev-parse', branch_ref], + stdout=subprocess.PIPE, + universal_newlines=True, + ) if out.returncode != 0: return None |