Skip to content

Commit

Permalink
Make mypy happy with the optional import of argcomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmcorvidae committed Dec 22, 2024
1 parent 245a9e4 commit 0b15453
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 16 in meshtastic/__main__.py

View check run for this annotation

Codecov / codecov/patch

meshtastic/__main__.py#L15-L16

Added lines #L15 - L16 were not covered by tests

import logging
import os
import platform
import sys
import time
from typing import List, Optional

try:
import pyqrcode # type: ignore[import-untyped]
Expand Down

0 comments on commit 0b15453

Please sign in to comment.