Skip to content

Commit 0b15453

Browse files
committed
Make mypy happy with the optional import of argcomplete
1 parent 245a9e4 commit 0b15453

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

meshtastic/__main__.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@
55
# later we can have a separate changelist to refactor main.py into smaller files
66
# pylint: disable=too-many-lines
77

8+
from typing import List, Optional, Union
9+
from types import ModuleType
10+
811
import argparse
12+
argcomplete: Union[None, ModuleType] = None
913
try:
1014
import argcomplete
1115
except ImportError as e:
12-
argcomplete = None
16+
pass # already set to None by default above
1317

1418
import logging
1519
import os
1620
import platform
1721
import sys
1822
import time
19-
from typing import List, Optional
2023

2124
try:
2225
import pyqrcode # type: ignore[import-untyped]

0 commit comments

Comments
 (0)