diff --git a/pycvesearch/core.py b/pycvesearch/core.py index b728f12..4411fc6 100644 --- a/pycvesearch/core.py +++ b/pycvesearch/core.py @@ -1,8 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import pkg_resources - +from importlib.metadata import version from typing import Optional, Dict, MutableMapping from urllib.parse import urljoin @@ -18,7 +17,7 @@ def __init__(self, base_url: str, proxies: MutableMapping[str, str]={}, timeout: self.session.proxies = proxies self.session.headers.update({ 'content-type': 'application/json', - 'User-Agent': useragent if useragent else f'PyCVESearch / {pkg_resources.get_distribution("pycvesearch").version}'}) + 'User-Agent': useragent if useragent else f'PyCVESearch / {version("pycvesearch")}'}) self.timeout = timeout self.verify = verify