From 84753122b486c60f59df55f48d5ac4041434b884 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 8 Feb 2023 18:40:42 -0600 Subject: [PATCH] Fix mypy --- .../opentelemetry/util/_importlib_metadata.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py b/opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py index 71bc92e60ad..fca17b30691 100644 --- a/opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py +++ b/opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +# type: ignore + from sys import version_info -from typing import Dict, List, Union +from typing import Dict, Tuple, Union # This is a cache to avoid going through creating a dictionary for all entry # points for 3.7 every time the entry points function is called. -result_entry_points_37 = {} +result_entry_points_37 = {} # type: ignore # FIXME remove this when support for 3.7 is dropped. if version_info.minor == 7: @@ -28,7 +30,9 @@ ) from importlib_metadata import version - def entry_points(group: str = None, name: str = None) -> Union[List, Dict]: + def entry_points( + group: str = None, name: str = None + ) -> Union[Tuple, Dict]: if group is None and name is None: @@ -84,7 +88,9 @@ def entry_points(group: str = None, name: str = None) -> Union[List, Dict]: ) from importlib.metadata import version - def entry_points(group: str = None, name: str = None) -> Union[List, Dict]: + def entry_points( + group: str = None, name: str = None + ) -> Union[Tuple, Dict]: result_key_entry_points = importlib_metadata_entry_points() @@ -130,7 +136,9 @@ def entry_points(group: str = None, name: str = None) -> Union[List, Dict]: ) from importlib.metadata import version - def entry_points(group: str = None, name: str = None) -> Union[List, Dict]: + def entry_points( + group: str = None, name: str = None + ) -> Union[Tuple, Dict]: if group is None and name is None: result_entry_points = {}