Skip to content

Commit b525cb2

Browse files
addressing PR comments
Signed-off-by: grantlouisherman <grantlouisherman041@gmail.com>
1 parent 4587db4 commit b525cb2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/asyncio/base_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ async def _sock_sendfile_native(self, sock, file, offset, count):
969969
f"and file {file!r} combination")
970970

971971
async def _sock_sendfile_fallback(self, sock, file, offset, count):
972-
if isinstance(offset, int):
972+
if hasattr(file, 'seek'):
973973
file.seek(offset)
974974
blocksize = (
975975
min(count, constants.SENDFILE_FALLBACK_READBUFFER_SIZE)
@@ -1294,7 +1294,7 @@ async def _sendfile_native(self, transp, file, offset, count):
12941294
"sendfile syscall is not supported")
12951295

12961296
async def _sendfile_fallback(self, transp, file, offset, count):
1297-
if isinstance(offset, int):
1297+
if hasattr(file, 'seek'):
12981298
file.seek(offset)
12991299
blocksize = min(count, 16384) if count else 16384
13001300
buf = bytearray(blocksize)

0 commit comments

Comments
 (0)