We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 482aa5b commit db08c65Copy full SHA for db08c65
src/client/delphi_epidata.py
@@ -14,14 +14,14 @@
14
from tenacity import retry, stop_after_attempt
15
16
from aiohttp import ClientSession, TCPConnector, BasicAuth
17
-from pkg_resources import get_distribution, DistributionNotFound
+from importlib.metadata import version, PackageNotFoundError
18
19
# Obtain package version for the user-agent. Uses the installed version by
20
# preference, even if you've installed it and then use this script independently
21
# by accident.
22
try:
23
- _version = get_distribution("delphi-epidata").version
24
-except DistributionNotFound:
+ _version = version("delphi-epidata")
+except PackageNotFoundError:
25
_version = "0.script"
26
27
_HEADERS = {"user-agent": "delphi_epidata/" + _version + " (Python)"}
0 commit comments