Skip to content

Commit

Permalink
Don't decode a unicode string when using git version
Browse files Browse the repository at this point in the history
In #907, the git sha1 was added to the version string on
development builds.  In #2158, `encoding="utf-8"` was added
in `_minimal_ext_cmd`, which changed the output from a
bytestring to a regular string.  However, the original
code path still expects a bytestring and calls `.decode()` on it.
This fixes it in the way most obvious to me.
  • Loading branch information
garrison committed Nov 22, 2024
1 parent 269c26f commit 728f0f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qiskit_aer/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def git_version():
# Determine if we're at main
try:
out = _minimal_ext_cmd(["git", "rev-parse", "HEAD"])
git_revision = out.strip().decode("ascii")
git_revision = out.strip()
except OSError:
git_revision = "Unknown"

Expand Down

0 comments on commit 728f0f6

Please sign in to comment.