diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py index 84a8791ce60..0bdf3213883 100644 --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -765,10 +765,11 @@ class GTestCommands(MachCommandBase): # current OS. debugger = mozdebug.get_default_debugger_name(mozdebug.DebuggerSearch.KeepLooking) - debuggerInfo = mozdebug.get_debugger_info(debugger, debugger_args) - if not debuggerInfo: - print("Could not find a suitable debugger in your PATH.") - return 1 + if debugger: + debuggerInfo = mozdebug.get_debugger_info(debugger, debugger_args) + if not debuggerInfo: + print("Could not find a suitable debugger in your PATH.") + return 1 # Parameters come from the CLI. We need to convert them before # their use. @@ -942,10 +943,11 @@ class RunProgram(MachCommandBase): # current OS. debugger = mozdebug.get_default_debugger_name(mozdebug.DebuggerSearch.KeepLooking) - self.debuggerInfo = mozdebug.get_debugger_info(debugger, debugparams) - if not self.debuggerInfo: - print("Could not find a suitable debugger in your PATH.") - return 1 + if debugger: + self.debuggerInfo = mozdebug.get_debugger_info(debugger, debugparams) + if not self.debuggerInfo: + print("Could not find a suitable debugger in your PATH.") + return 1 # Parameters come from the CLI. We need to convert them before # their use. diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index 82a08d9a4b7..7107b926ea7 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -1801,9 +1801,11 @@ class Mochitest(MochitestUtilsMixin): # TODO: use mozrunner.local.debugger_arguments: # https://github.com/mozilla/mozbase/blob/master/mozrunner/mozrunner/local.py#L42 - debuggerInfo = mozdebug.get_debugger_info(options.debugger, - options.debuggerArgs, - options.debuggerInteractive) + debuggerInfo = None + if options.debugger: + debuggerInfo = mozdebug.get_debugger_info(options.debugger, + options.debuggerArgs, + options.debuggerInteractive) if options.useTestMediaDevices: devices = findTestMediaDevices(self.log)