Skip to content

Commit

Permalink
Deprecation warning - alternative (#3615)
Browse files Browse the repository at this point in the history
* Alternative solution

* BLACK

* Args

* Changes

* style

* Ordering

* Debug shows warnings

* style
  • Loading branch information
Stonedestroyer authored Feb 28, 2020
1 parent 582f64b commit ad4a75b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions redbot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,26 @@ def _update_event_loop_policy():
_warnings.filterwarnings("ignore", module=r"fuzzywuzzy.*")
# Show DeprecationWarning
_warnings.filterwarnings("default", category=DeprecationWarning)

if "--debug" not in _sys.argv:
# DEP-WARN
# Individual warnings - tracked in https://github.com/Cog-Creators/Red-DiscordBot/issues/3529
# DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
_warnings.filterwarnings("ignore", category=DeprecationWarning, module="importlib", lineno=219)
# DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
# def noop(*args, **kwargs): # type: ignore
_warnings.filterwarnings("ignore", category=DeprecationWarning, module="aiohttp", lineno=107)
# DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
# hosts = await asyncio.shield(self._resolve_host(..
_warnings.filterwarnings("ignore", category=DeprecationWarning, module="aiohttp", lineno=964)
# DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
# self._event = asyncio.Event(loop=loop)
_warnings.filterwarnings("ignore", category=DeprecationWarning, module="aiohttp", lineno=21)
# DeprecationWarning: rename klass to create_protocol
# warnings.warn("rename klass to create_protocol", DeprecationWarning)
#
# discord.py is using deprecated kwarg name when making websockets connection
# https://github.com/Rapptz/discord.py/issues/2574
_warnings.filterwarnings(
"ignore", category=DeprecationWarning, module="websockets", lineno=407
)

0 comments on commit ad4a75b

Please sign in to comment.