зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1580492 - Run mach 'core' commands with Python 3. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D45694 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
28c79c116e
Коммит
a19f899a6f
4
mach
4
mach
|
@ -56,9 +56,6 @@ py2commands="
|
|||
jstestbrowser
|
||||
jstests
|
||||
lint
|
||||
mach-commands
|
||||
mach-completion
|
||||
mach-debug-commands
|
||||
marionette-test
|
||||
mochitest
|
||||
mozbuild-reference
|
||||
|
@ -86,7 +83,6 @@ py2commands="
|
|||
run-android
|
||||
run-desktop
|
||||
rusttests
|
||||
settings
|
||||
show-log
|
||||
static-analysis
|
||||
talos-test
|
||||
|
|
|
@ -385,7 +385,7 @@ class CommandAction(argparse.Action):
|
|||
' subcommand [subcommand arguments]'
|
||||
group = parser.add_argument_group('Sub Commands')
|
||||
|
||||
for subcommand, subhandler in sorted(handler.subcommand_handlers.iteritems()):
|
||||
for subcommand, subhandler in sorted(handler.subcommand_handlers.items()):
|
||||
group.add_argument(subcommand, help=subhandler.description,
|
||||
action='store_true')
|
||||
|
||||
|
@ -397,7 +397,7 @@ class CommandAction(argparse.Action):
|
|||
parser.print_help()
|
||||
|
||||
def _handle_subcommand_help(self, parser, handler, args):
|
||||
subcommand = set(args).intersection(handler.subcommand_handlers.keys())
|
||||
subcommand = set(args).intersection(list(handler.subcommand_handlers.keys()))
|
||||
if not subcommand:
|
||||
return self._handle_subcommand_main_help(parser, handler)
|
||||
|
||||
|
@ -452,13 +452,13 @@ def format_docstring(docstring):
|
|||
if not docstring:
|
||||
return ''
|
||||
lines = docstring.expandtabs().splitlines()
|
||||
indent = sys.maxint
|
||||
indent = sys.maxsize
|
||||
for line in lines[1:]:
|
||||
stripped = line.lstrip()
|
||||
if stripped:
|
||||
indent = min(indent, len(line) - len(stripped))
|
||||
trimmed = [lines[0].strip()]
|
||||
if indent < sys.maxint:
|
||||
if indent < sys.maxsize:
|
||||
for line in lines[1:]:
|
||||
trimmed.append(line[indent:].rstrip())
|
||||
while trimmed and not trimmed[-1]:
|
||||
|
|
Загрузка…
Ссылка в новой задаче