Skip to content

Commit

Permalink
Replace deprecated pkg_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
rzats committed Jan 4, 2024
1 parent 81b9ac0 commit f7bc504
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/delphi_epidata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
from tenacity import retry, stop_after_attempt

from aiohttp import ClientSession, TCPConnector, BasicAuth
from pkg_resources import get_distribution, DistributionNotFound
from importlib.metadata import version, PackageNotFoundError

# Obtain package version for the user-agent. Uses the installed version by
# preference, even if you've installed it and then use this script independently
# by accident.
try:
_version = get_distribution("delphi-epidata").version
except DistributionNotFound:
_version = version("delphi-epidata")
except PackageNotFoundError:
_version = "0.script"

_HEADERS = {"user-agent": "delphi_epidata/" + _version + " (Python)"}
Expand Down

0 comments on commit f7bc504

Please sign in to comment.