summaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorskullY <skullydazed@gmail.com>2019-11-12 17:21:33 -0800
committerskullydazed <skullydazed@users.noreply.github.com>2019-11-12 18:40:24 -0800
commitd1b6c11b7f4cc24c50d2b640a94925acf6450da6 (patch)
treeb08e5a33799012a5d03c556cd061c31c4a13546b /lib/python
parent5421ba11dedd9912967b1fa5ed1f664687221143 (diff)
downloadqmk_firmware-d1b6c11b7f4cc24c50d2b640a94925acf6450da6.tar.gz
qmk_firmware-d1b6c11b7f4cc24c50d2b640a94925acf6450da6.zip
When checking program returncodes treat both 0 and 1 as installed
Diffstat (limited to 'lib/python')
-rwxr-xr-xlib/python/qmk/cli/doctor.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/python/qmk/cli/doctor.py b/lib/python/qmk/cli/doctor.py
index 309de0c671..c2723bfcbb 100755
--- a/lib/python/qmk/cli/doctor.py
+++ b/lib/python/qmk/cli/doctor.py
@@ -24,8 +24,7 @@ def doctor(cli):
cli.log.info('QMK Doctor is checking your environment.')
# Make sure the basic CLI tools we need are available and can be executed.
- binaries = ['dfu-programmer', 'avrdude', 'dfu-util', 'avr-gcc', 'arm-none-eabi-gcc']
- binaries += glob('bin/qmk-*')
+ binaries = ['dfu-programmer', 'avrdude', 'dfu-util', 'avr-gcc', 'arm-none-eabi-gcc', 'bin/qmk']
ok = True
for binary in binaries:
@@ -34,10 +33,10 @@ def doctor(cli):
cli.log.error("{fg_red}QMK can't find %s in your path.", binary)
ok = False
else:
- try:
- subprocess.run([binary, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5, check=True)
+ check = subprocess.run([binary, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5)
+ if check.returncode in [0, 1]:
cli.log.info('Found {fg_cyan}%s', binary)
- except subprocess.CalledProcessError:
+ else:
cli.log.error("{fg_red}Can't run `%s --version`", binary)
ok = False