This commit is contained in:
@@ -10,6 +10,7 @@ from io import (
|
||||
FileIO,
|
||||
TextIOBase,
|
||||
)
|
||||
from types import coroutine
|
||||
|
||||
from ..base import AiofilesContextManager
|
||||
from .binary import (
|
||||
@@ -62,7 +63,8 @@ def open(
|
||||
)
|
||||
|
||||
|
||||
async def _open(
|
||||
@coroutine
|
||||
def _open(
|
||||
file,
|
||||
mode="r",
|
||||
buffering=-1,
|
||||
@@ -89,7 +91,7 @@ async def _open(
|
||||
closefd=closefd,
|
||||
opener=opener,
|
||||
)
|
||||
f = await loop.run_in_executor(executor, cb)
|
||||
f = yield from loop.run_in_executor(executor, cb)
|
||||
|
||||
return wrap(f, loop=loop, executor=executor)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user