mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Set codec error handler for git hash detection
This commit is contained in:
parent
92c4874620
commit
062a2e1d05
@ -40,13 +40,13 @@ if _in_development:
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
ret = subprocess.run(
|
||||
['git', 'show', '-s', '--pretty=format:%h'],
|
||||
if ret := subprocess.run(
|
||||
['git', 'rev-parse', '--short', 'HEAD'],
|
||||
cwd=package_dir,
|
||||
capture_output=True,
|
||||
encoding='ascii',
|
||||
).stdout
|
||||
if ret:
|
||||
errors='surrogateescape',
|
||||
).stdout:
|
||||
__display_version__ += '+/' + ret.strip()
|
||||
del ret
|
||||
finally:
|
||||
|
Loading…
Reference in New Issue
Block a user