Commit 69cbba1e authored by henry's avatar henry Committed by Dan Ballard
Browse files

fixup! BB 41803: Add some developer tools for working on tor-browser.

TB 44367: Make the argcomplete module optional.
parent 5b9a5b96
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -15,9 +15,14 @@ import tempfile
import termios
import urllib.request
from collections.abc import Callable, Iterable, Iterator
from types import ModuleType
from typing import Any, NotRequired, TypedDict, TypeVar

argcomplete: None | ModuleType = None
try:
    import argcomplete
except ImportError:
    pass

GIT_PATH = "/usr/bin/git"
UPSTREAM_URLS = {
@@ -943,9 +948,10 @@ for name, command_config in all_commands.items():
            completer = keywords["completer"]
            del keywords["completer"]
        sub_arg = sub.add_argument(arg, **keywords)
        if completer is not None:
        if completer is not None and argcomplete is not None:
            sub_arg.completer = completer  # type: ignore

if argcomplete is not None:
    argcomplete.autocomplete(parser)

try: