Skip to content

Commit e4cbff3

Browse files
committed
Complete forgotten await
1 parent 0b9dd91 commit e4cbff3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/py/kaleido/kaleido.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
_stepper = False
3535

3636

37-
def _to_thread(func, *args, **kwargs):
37+
async def _to_thread(func, *args, **kwargs):
3838
_loop = asyncio.get_running_loop()
3939
fn = partial(func, *args, **kwargs)
40-
_loop.run_in_executor(None, fn)
40+
await _loop.run_in_executor(None, fn)
4141

4242

4343
# this is kinda public but undocumented
@@ -376,7 +376,7 @@ def write_image(binary):
376376
file.write(binary)
377377

378378
_logger.info(f"Starting write of {full_path.name}")
379-
_to_thread(write_image, img)
379+
await _to_thread(write_image, img)
380380
_logger.info(f"Wrote {full_path.name}")
381381
if profiler is not None:
382382
self._finish_profile(profile, e, full_path.stat().st_size / 1000000)

0 commit comments

Comments
 (0)