mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
Tools: Don't print git failure message for version detection
This commit is contained in:
parent
49e9f254c5
commit
d93380e8f6
@ -988,12 +988,15 @@ def get_python_env_path(): # type: () -> Tuple[str, str, str, str]
|
||||
idf_version_str = ''
|
||||
try:
|
||||
idf_version_str = subprocess.check_output(['git', 'describe'],
|
||||
cwd=global_idf_path, env=os.environ).decode()
|
||||
cwd=global_idf_path, env=os.environ,
|
||||
stderr=subprocess.DEVNULL).decode()
|
||||
except OSError:
|
||||
# OSError should cover FileNotFoundError and WindowsError
|
||||
warn('Git was not found')
|
||||
except subprocess.CalledProcessError as e:
|
||||
warn('Git describe was unsuccessful: {}'.format(e.output))
|
||||
except subprocess.CalledProcessError:
|
||||
# This happens quite often when the repo is shallow. Don't print a warning because there are other
|
||||
# possibilities for version detection.
|
||||
pass
|
||||
match = re.match(r'^v([0-9]+\.[0-9]+).*', idf_version_str)
|
||||
if match:
|
||||
idf_version = match.group(1) # type: Optional[str]
|
||||
|
Loading…
x
Reference in New Issue
Block a user