diff --git a/opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py b/opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py index 526204cb783..52689ad379c 100644 --- a/opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py +++ b/opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py @@ -17,10 +17,6 @@ from sys import version_info 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 = {} - # FIXME remove this when support for 3.7 is dropped. if version_info.minor == 7: # pylint: disable=import-error @@ -30,6 +26,10 @@ ) from importlib_metadata import version + # 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 = {} + def entry_points( group: str = None, name: str = None ) -> Union[Tuple[EntryPoint], Dict[str, Tuple[EntryPoint]]]: