mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
fix(ble_log): use typing.Optional/List for Python 3.9 compatibility
This commit is contained in:
@@ -10,13 +10,15 @@ import re
|
||||
import shutil
|
||||
import tempfile
|
||||
import unittest
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
|
||||
import test_utils # noqa: F401 — must be first to set up sys.path
|
||||
from ble_log_compress import ARG_SIZE_TYPE
|
||||
from test_utils import PipelineContext
|
||||
|
||||
|
||||
def _extract_size_types_from_macro(macro_str: str) -> list[int] | None:
|
||||
def _extract_size_types_from_macro(macro_str: str) -> Optional[List[int]]:
|
||||
"""Extract size type values from a generated macro string."""
|
||||
m = re.search(r'ble_log_compressed_hex_print\(\d+,\d+, (\d+)(?:, (.+?))?(?:,\s*[a-zA-Z_])', macro_str)
|
||||
if not m:
|
||||
|
||||
@@ -16,6 +16,8 @@ import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
|
||||
TESTS_DIR = Path(__file__).resolve().parent
|
||||
SCRIPTS_DIR = TESTS_DIR.parent / 'scripts'
|
||||
@@ -39,7 +41,7 @@ BLUEDROID_TAGS = [
|
||||
]
|
||||
|
||||
|
||||
def run_pipeline(fixture_files: list[str], output_name: str, tags_with_preserve: list[str] | None = None) -> None:
|
||||
def run_pipeline(fixture_files: List[str], output_name: str, tags_with_preserve: Optional[List[str]] = None) -> None:
|
||||
"""Run compression on fixture files and save the generated header as a golden file."""
|
||||
tags_with_preserve = tags_with_preserve or ['APPL_TRACE_ERROR', 'APPL_TRACE_WARNING']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user