Skip to content

Commit e25732f

Browse files
authored
Fix blocking IO in event loop (#374)
1 parent 1144cc3 commit e25732f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/python_opensky/opensky.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
from typing_extensions import Self
2727

2828

29+
VERSION = metadata.version(__package__)
30+
31+
2932
@dataclass
3033
class OpenSky:
3134
"""Main class for handling connections with OpenSky."""
@@ -97,7 +100,6 @@ async def _request(
97100
OpenSkyrror: Received an unexpected response from the OpenSky API.
98101
99102
"""
100-
version = metadata.version(__package__)
101103
url = URL.build(
102104
scheme="https",
103105
host=self.api_host,
@@ -106,7 +108,7 @@ async def _request(
106108
).joinpath(uri)
107109

108110
headers = {
109-
"User-Agent": f"PythonOpenSky/{version}",
111+
"User-Agent": f"PythonOpenSky/{VERSION}",
110112
"Accept": "application/json, text/plain, */*",
111113
}
112114

0 commit comments

Comments
 (0)