From b88f9f0acfbcc64ce5c82573b5eb044eeb24f8da Mon Sep 17 00:00:00 2001 From: Andrea Righi Date: Fri, 7 Jul 2023 10:28:29 +0200 Subject: [PATCH] annotations: make argcomplete optional Allow to run the main script also when argcomplete is not available. Signed-off-by: Andrea Righi --- kconfig/run.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.31.1