From 6443a54d97a3e7bffc6bfd92624d425cced0d579 Mon Sep 17 00:00:00 2001 From: Nick80835 Date: Sun, 22 Oct 2023 18:58:23 -0400 Subject: [PATCH] remove the last while True --- ubot/fixes/fast_telethon.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ubot/fixes/fast_telethon.py b/ubot/fixes/fast_telethon.py index e7865fa..a0ae276 100644 --- a/ubot/fixes/fast_telethon.py +++ b/ubot/fixes/fast_telethon.py @@ -33,12 +33,7 @@ TypeLocation = Union[Document, InputDocumentFileLocation, InputPeerPhotoFileLoca def stream_file(file_to_stream: BinaryIO, chunk_size=1024): - while True: - data_read = file_to_stream.read(chunk_size) - - if not data_read: - break - + while data_read := file_to_stream.read(chunk_size): yield data_read