Merge pull request #1556 from SteadBytes/python3-popen-bytes
Decode Popen stdout bytes to utf-8
This commit is contained in:
@@ -43,7 +43,7 @@ def findGitHash():
|
|||||||
try:
|
try:
|
||||||
p = Popen('git rev-parse HEAD', stdout=PIPE, stderr=PIPE, shell=True)
|
p = Popen('git rev-parse HEAD', stdout=PIPE, stderr=PIPE, shell=True)
|
||||||
p.stderr.close()
|
p.stderr.close()
|
||||||
line = p.stdout.readlines()[0].strip()
|
line = p.stdout.readlines()[0].decode('utf-8').strip()
|
||||||
if line and len(line) == 40 and all(c in hexdigits for c in line):
|
if line and len(line) == 40 and all(c in hexdigits for c in line):
|
||||||
return line
|
return line
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -59,7 +59,7 @@ def findGitVersion():
|
|||||||
try:
|
try:
|
||||||
p = Popen('git describe --tags --match "v*.*.*"', stdout=PIPE, stderr=PIPE, shell=True)
|
p = Popen('git describe --tags --match "v*.*.*"', stdout=PIPE, stderr=PIPE, shell=True)
|
||||||
p.stderr.close()
|
p.stderr.close()
|
||||||
line = p.stdout.readlines()[0]
|
line = p.stdout.readlines()[0].decode('utf-8')
|
||||||
if line.startswith('release-'):
|
if line.startswith('release-'):
|
||||||
line = line.split('-', 1)[1]
|
line = line.split('-', 1)[1]
|
||||||
if line.startswith('v'):
|
if line.startswith('v'):
|
||||||
|
|||||||
Reference in New Issue
Block a user