forked from espressif/esp-idf
Merge branch 'bugfix/fix_tools_idf_tools_exception_with_python3' into 'master'
CI: fix CI tools exception with python3 Closes IDF-769 See merge request espressif/esp-idf!5443
This commit is contained in:
@@ -34,8 +34,9 @@ def target_branch_candidates(proj_name):
|
|||||||
except (KeyError, TypeError):
|
except (KeyError, TypeError):
|
||||||
pass
|
pass
|
||||||
# branch name read from IDF
|
# branch name read from IDF
|
||||||
|
try:
|
||||||
git_describe = subprocess.check_output(["git", "describe", "--tags", "HEAD"])
|
git_describe = subprocess.check_output(["git", "describe", "--tags", "HEAD"])
|
||||||
match = IDF_GIT_DESCRIBE_PATTERN.search(git_describe)
|
match = IDF_GIT_DESCRIBE_PATTERN.search(git_describe.decode())
|
||||||
if match:
|
if match:
|
||||||
major_revision = match.group(1)
|
major_revision = match.group(1)
|
||||||
minor_revision = match.group(2)
|
minor_revision = match.group(2)
|
||||||
@@ -44,6 +45,9 @@ def target_branch_candidates(proj_name):
|
|||||||
# branch to match all major branches, like v3.x or v3
|
# branch to match all major branches, like v3.x or v3
|
||||||
candidates.append("release/v{}.x".format(major_revision))
|
candidates.append("release/v{}.x".format(major_revision))
|
||||||
candidates.append("release/v{}".format(major_revision))
|
candidates.append("release/v{}".format(major_revision))
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
# this should not happen as IDF should have describe message
|
||||||
|
pass
|
||||||
|
|
||||||
return [c for c in candidates if c] # filter out null value
|
return [c for c in candidates if c] # filter out null value
|
||||||
|
|
||||||
|
@@ -175,7 +175,7 @@ def run_cmd_check_output(cmd, input_text=None, extra_paths=None):
|
|||||||
input_text = input_text.encode()
|
input_text = input_text.encode()
|
||||||
result = subprocess.run(cmd, capture_output=True, check=True, input=input_text)
|
result = subprocess.run(cmd, capture_output=True, check=True, input=input_text)
|
||||||
return result.stdout + result.stderr
|
return result.stdout + result.stderr
|
||||||
except AttributeError:
|
except (AttributeError, TypeError):
|
||||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
|
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
stdout, stderr = p.communicate(input_text)
|
stdout, stderr = p.communicate(input_text)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
|
Reference in New Issue
Block a user