Use binary strings for compatibility with Python 3

This commit is contained in:
camelid 2020-05-31 09:20:08 -07:00
parent e362538bf2
commit 2e5ad99022

View file

@ -741,10 +741,10 @@ install them, let us know by filing a bug!")
git_sha = None git_sha = None
# Check if it's a bundle commit # Check if it's a bundle commit
if git_commit_subject.startswith("Shallow version of commit "): if git_commit_subject.startswith(b"Shallow version of commit "):
# This is a bundle commit # This is a bundle commit
# Get the SHA-1 from the bundle subject: "Shallow version of commit {sha1}" # Get the SHA-1 from the bundle subject: "Shallow version of commit {sha1}"
git_sha = git_commit_subject.split(' ')[-1].strip() git_sha = git_commit_subject.split(b' ')[-1].strip()
# Shorten hash # Shorten hash
# NOTE: Partially verifies the hash, but it will still pass if it's, e.g., a tree # NOTE: Partially verifies the hash, but it will still pass if it's, e.g., a tree
git_sha = subprocess.check_output([ git_sha = subprocess.check_output([