Skip to content

Commit

Permalink
Fix blocking IO in event loop (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Jun 29, 2024
1 parent 1144cc3 commit e25732f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/python_opensky/opensky.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
from typing_extensions import Self


VERSION = metadata.version(__package__)


@dataclass
class OpenSky:
"""Main class for handling connections with OpenSky."""
Expand Down Expand Up @@ -97,7 +100,6 @@ async def _request(
OpenSkyrror: Received an unexpected response from the OpenSky API.
"""
version = metadata.version(__package__)
url = URL.build(
scheme="https",
host=self.api_host,
Expand All @@ -106,7 +108,7 @@ async def _request(
).joinpath(uri)

headers = {
"User-Agent": f"PythonOpenSky/{version}",
"User-Agent": f"PythonOpenSky/{VERSION}",
"Accept": "application/json, text/plain, */*",
}

Expand Down

0 comments on commit e25732f

Please sign in to comment.