Skip to content

Commit

Permalink
fix migrated to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyCMWF committed Oct 24, 2024
1 parent 9b162d6 commit cc9a875
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cdsapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import time
import uuid

import pkg_resources
from importlib.metadata import version
import requests

try:
Expand Down Expand Up @@ -347,8 +347,7 @@ def __init__(
self.session = session
self.session.auth = tuple(self.key.split(":", 2))
self.session.headers = {
"User-Agent": "cdsapi/%s"
% pkg_resources.get_distribution("cdsapi").version,
"User-Agent": f"cdsapi/{version('cdsapi')}",
}

assert len(self.session.auth) == 2, (
Expand Down

0 comments on commit cc9a875

Please sign in to comment.