Set codec error handler for git hash detection

This commit is contained in:
Adam Turner 2023-08-05 03:50:52 +01:00
parent 92c4874620
commit 062a2e1d05

View File

@ -40,13 +40,13 @@ if _in_development:
import subprocess import subprocess
try: try:
ret = subprocess.run( if ret := subprocess.run(
['git', 'show', '-s', '--pretty=format:%h'], ['git', 'rev-parse', '--short', 'HEAD'],
cwd=package_dir, cwd=package_dir,
capture_output=True, capture_output=True,
encoding='ascii', encoding='ascii',
).stdout errors='surrogateescape',
if ret: ).stdout:
__display_version__ += '+/' + ret.strip() __display_version__ += '+/' + ret.strip()
del ret del ret
finally: finally: