From: Andrea Righi Date: Fri, 7 Jul 2023 08:28:29 +0000 (+0200) Subject: annotations: make argcomplete optional X-Git-Tag: v0.2~22 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=b88f9f0acfbcc64ce5c82573b5eb044eeb24f8da;p=annotations.git annotations: make argcomplete optional Allow to run the main script also when argcomplete is not available. Signed-off-by: Andrea Righi --- diff --git a/kconfig/run.py b/kconfig/run.py index 8f24a8d..440dcda 100644 --- a/kconfig/run.py +++ b/kconfig/run.py @@ -8,7 +8,13 @@ import os import argparse import json from signal import signal, SIGPIPE, SIG_DFL -from argcomplete import autocomplete + +try: + from argcomplete import autocomplete +except ModuleNotFoundError: + # Allow to run this program also when argcomplete is not available + def autocomplete(_unused): + pass from kconfig.annotations import Annotation, KConfig from kconfig.utils import autodetect_annotations, arg_fail