Исправление: monkey-patch asyncio.iscoroutinefunction для устранения 53 deprecation warnings
This commit is contained in:
parent
65e01f0091
commit
faad12a0a6
5
bot.py
5
bot.py
@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
import inspect
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
@ -6,6 +7,10 @@ import threading
|
||||
import time
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
# Python 3.14+: asyncio.iscoroutinefunction deprecated, removed in 3.16
|
||||
# discord.py 2.7.1 ещё не обновлена — применяем monkey-patch до импорта
|
||||
asyncio.iscoroutinefunction = inspect.iscoroutinefunction # type: ignore[assignment]
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands import CommandNotFound
|
||||
|
||||
8
conftest.py
Normal file
8
conftest.py
Normal file
@ -0,0 +1,8 @@
|
||||
"""Pytest configuration — применяется до импорта тестов."""
|
||||
|
||||
import asyncio
|
||||
import inspect
|
||||
|
||||
# Python 3.14+: asyncio.iscoroutinefunction deprecated, removed in 3.16
|
||||
# discord.py 2.7.1 ещё не обновлена — применяем monkey-patch до импорта
|
||||
asyncio.iscoroutinefunction = inspect.iscoroutinefunction # type: ignore[assignment]
|
||||
Loading…
x
Reference in New Issue
Block a user