Skip to content

Commit 5e8c2d2

Browse files
Merge pull request #1150 from planetlabs/main
3.0 update from current 2.0 main
2 parents bedbf62 + 263fbf6 commit 5e8c2d2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

planet/http.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ async def alog_response(*args, **kwargs):
276276
self._limiter = _Limiter(rate_limit=RATE_LIMIT, max_workers=MAX_ACTIVE)
277277
self.outcomes: Counter[str] = Counter()
278278

279+
self._loop: asyncio.AbstractEventLoop = None # type: ignore
280+
281+
def _init_loop(self):
282+
if self._loop:
283+
return
284+
279285
# create a dedicated event loop for this httpx session.
280286
def _start_background_loop(loop):
281287
asyncio.set_event_loop(loop)
@@ -288,6 +294,7 @@ def _start_background_loop(loop):
288294
self._loop_thread.start()
289295

290296
def _call_sync(self, f: Awaitable[T]) -> T:
297+
self._init_loop()
291298
return asyncio.run_coroutine_threadsafe(f, self._loop).result()
292299

293300
@classmethod

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "planet"
77
authors = [{ name = "Planet", email = "[email protected]" }]
88
description = "Planet SDK for Python"
99
dependencies = [
10-
"click>=8.0",
10+
"click (>=8.0,!=8.2.1)",
1111
"geojson",
1212
"httpx>=0.28.0",
1313
"jsonschema",

0 commit comments

Comments
 (0)