mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
bug 1517811 - use mozdebug in mach to validate debugger arguments. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D15847 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
dfa5c93420
commit
7f6bbcf435
@ -455,7 +455,7 @@ To see more help for a specific command, run:
|
||||
def _check_debugger(program):
|
||||
"""Checks if debugger specified in command line is installed.
|
||||
|
||||
This internal function calls an in-tree library 'which'.
|
||||
Uses mozdebug to locate debuggers.
|
||||
|
||||
If the call does not raise any exceptions, mach is permitted
|
||||
to continue execution.
|
||||
@ -465,10 +465,9 @@ To see more help for a specific command, run:
|
||||
Args:
|
||||
program (str): debugger program name.
|
||||
"""
|
||||
from which import which, WhichError
|
||||
try:
|
||||
which(program)
|
||||
except WhichError:
|
||||
import mozdebug
|
||||
info = mozdebug.get_debugger_info(program)
|
||||
if info is None:
|
||||
print("Specified debugger '{}' is not found.\n".format(program) +
|
||||
"Is it installed? Is it in your PATH?")
|
||||
sys.exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user