mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
remove typing as a dependency.
return None if the input is None
This commit is contained in:
parent
5c92d36078
commit
d06d2a2b9f
@ -15,8 +15,6 @@ import functools
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from tiny_test_fw import TinyFW, Utility
|
from tiny_test_fw import TinyFW, Utility
|
||||||
from .IDFApp import IDFApp, Example, LoadableElfTestApp, UT, TestApp # noqa: export all Apps for users
|
from .IDFApp import IDFApp, Example, LoadableElfTestApp, UT, TestApp # noqa: export all Apps for users
|
||||||
from .IDFDUT import IDFDUT, ESP32DUT, ESP32S2DUT, ESP8266DUT, ESP32QEMUDUT # noqa: export DUTs for users
|
from .IDFDUT import IDFDUT, ESP32DUT, ESP32S2DUT, ESP8266DUT, ESP32QEMUDUT # noqa: export DUTs for users
|
||||||
@ -39,11 +37,11 @@ except NameError:
|
|||||||
string_type = str
|
string_type = str
|
||||||
|
|
||||||
|
|
||||||
def upper_list(text): # type: (Optional[string_type, list]) -> list
|
def upper_list(text):
|
||||||
|
if not text:
|
||||||
|
return text
|
||||||
if isinstance(text, string_type):
|
if isinstance(text, string_type):
|
||||||
res = [text.upper()]
|
res = [text.upper()]
|
||||||
elif text is None:
|
|
||||||
res = []
|
|
||||||
else:
|
else:
|
||||||
res = [item.upper() for item in text]
|
res = [item.upper() for item in text]
|
||||||
return res
|
return res
|
||||||
|
Loading…
x
Reference in New Issue
Block a user