From 0b1545393eefbc1fbea79941f314d12b3304b1e6 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Sat, 21 Dec 2024 20:23:35 -0700 Subject: [PATCH] Make mypy happy with the optional import of argcomplete --- meshtastic/__main__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index 14120e5c..40b46907 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -5,18 +5,21 @@ # later we can have a separate changelist to refactor main.py into smaller files # pylint: disable=too-many-lines +from typing import List, Optional, Union +from types import ModuleType + import argparse +argcomplete: Union[None, ModuleType] = None try: import argcomplete except ImportError as e: - argcomplete = None + pass # already set to None by default above import logging import os import platform import sys import time -from typing import List, Optional try: import pyqrcode # type: ignore[import-untyped]