mach run --debug: Cleanup: Use nicer syntax in rust-gdb/rust-lldb check

Follow-up on f3cd5d2961 : after actually
reading a Python tutorial, I realised this can be handled in a more
elegant fashion :-)
This commit is contained in:
Olaf Buddenhagen 2016-05-04 22:02:29 +02:00
parent a868bb2a90
commit 15066559a5

View file

@ -118,9 +118,10 @@ class PostBuildCommands(CommandBase):
rustCommand = 'rust-' + debugger
try:
subprocess.check_call([rustCommand, '--version'], env=env, stdout=open(os.devnull, 'w'))
command = rustCommand
except (OSError, subprocess.CalledProcessError):
pass
else:
command = rustCommand
# Prepend the debugger args.
args = ([command] + self.debuggerInfo.args +