Skip to content

Commit 17751ad

Browse files
committed
Update build_board_info.py to sh module 2.0.0
1 parent 795e46c commit 17751ad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/build_board_info.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import sys
1111
import sh
1212
import base64
13+
from io import StringIO
1314
from datetime import date
1415
from sh.contrib import git
1516

@@ -58,9 +59,13 @@ def get_languages(list_all=False):
5859

5960
def get_version_info():
6061
version = None
61-
sha = git("rev-parse", "--short", "HEAD").stdout.decode("utf-8")
62+
buffer = StringIO()
63+
git("rev-parse", "--short", "HEAD", _out=buffer)
64+
sha = buffer.getvalue().strip()
6265
try:
63-
version = git("describe", "--tags", "--exact-match").stdout.decode("utf-8").strip()
66+
buffer = StringIO()
67+
git("describe", "--tags", "--exact-match", _out=buffer)
68+
version = buffer.getvalue().strip()
6469
except sh.ErrorReturnCode_128:
6570
# No exact match
6671
pass

0 commit comments

Comments
 (0)