mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 22:54:33 +02:00
Tools: Don't print git failure message for version detection
This commit is contained in:
@@ -988,12 +988,15 @@ def get_python_env_path(): # type: () -> Tuple[str, str, str, str]
|
|||||||
idf_version_str = ''
|
idf_version_str = ''
|
||||||
try:
|
try:
|
||||||
idf_version_str = subprocess.check_output(['git', 'describe'],
|
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:
|
except OSError:
|
||||||
# OSError should cover FileNotFoundError and WindowsError
|
# OSError should cover FileNotFoundError and WindowsError
|
||||||
warn('Git was not found')
|
warn('Git was not found')
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError:
|
||||||
warn('Git describe was unsuccessful: {}'.format(e.output))
|
# 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)
|
match = re.match(r'^v([0-9]+\.[0-9]+).*', idf_version_str)
|
||||||
if match:
|
if match:
|
||||||
idf_version = match.group(1) # type: Optional[str]
|
idf_version = match.group(1) # type: Optional[str]
|
||||||
|
Reference in New Issue
Block a user