summaryrefslogtreecommitdiff
path: root/osprofiler/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'osprofiler/__init__.py')
-rw-r--r--osprofiler/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/osprofiler/__init__.py b/osprofiler/__init__.py
index 22bedd3..e9adf59 100644
--- a/osprofiler/__init__.py
+++ b/osprofiler/__init__.py
@@ -13,6 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-import pkg_resources
+try:
+ # For Python 3.8 and later
+ import importlib.metadata as importlib_metadata
+except ImportError:
+ # For everyone else
+ import importlib_metadata
-__version__ = pkg_resources.get_distribution("osprofiler").version
+__version__ = importlib_metadata.version("osprofiler")