1

我使用telethon库与电报客户一起工作。当我得到消息的迭代器时,在从聊天中读取所有消息后出现以下错误(即,阅读历史记录已完成):

Exception ignored in: <bound method AsyncGenerator.__del__ of <async_generator._impl.AsyncGenerator object at 0x7f2cbdc54f60>>

Traceback (most recent call last):

File "/home/ahmad/PycharmProjects/thelethontest/venv/lib/python3.5/site-packages/async_generator/_impl.py", line 324, in __del__
.format(self._coroutine.cr_frame.f_code.co_name)

RuntimeError: partially-exhausted async_generator 'iter_messages' garbage collected

为什么我会收到此错误,如何解决?


break我了解在 for 循环中使用时会发生此错误。我需要在某些情况下中断循环。我需要一个解决方案来打破循环而不会出错。

4

0 回答 0