mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-28 00:56:24 +00:00
🚑 hotfix: listen KeyError bug
This commit is contained in:
parent
a3ee603cd2
commit
f66530ac87
@ -18,7 +18,9 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with pyromod. If not, see <https://www.gnu.org/licenses/>.
|
along with pyromod. If not, see <https://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import contextlib
|
||||||
import functools
|
import functools
|
||||||
from typing import Optional, List, Union
|
from typing import Optional, List, Union
|
||||||
|
|
||||||
@ -70,8 +72,9 @@ class Client:
|
|||||||
|
|
||||||
@patchable
|
@patchable
|
||||||
def clear_listener(self, chat_id, future):
|
def clear_listener(self, chat_id, future):
|
||||||
if future == self.listening[chat_id]["future"]:
|
with contextlib.suppress(KeyError):
|
||||||
self.listening.pop(chat_id, None)
|
if future == self.listening[chat_id]["future"]:
|
||||||
|
self.listening.pop(chat_id, None)
|
||||||
|
|
||||||
@patchable
|
@patchable
|
||||||
def cancel_listener(self, chat_id):
|
def cancel_listener(self, chat_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user