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
|
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:
|
||||||
|
Loading…
Reference in New Issue
Block a user