Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Feb 9, 2023
1 parent b8eadc0 commit 8475312
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:

Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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 = {}
Expand Down

0 comments on commit 8475312

Please sign in to comment.