Skip to content

Commit

Permalink
Check against __qualname__ instead of isinstance in Client.__new__.
Browse files Browse the repository at this point in the history
Bump version (0, 7, 1)
  • Loading branch information
EvieePy committed May 2, 2020
1 parent d8c8a6c commit 181fef7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wavelink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__author__ = 'EvieePy'
__license__ = 'MIT'
__copyright__ = 'Copyright 2019-2020 (c) PythonistaGuild'
__version__ = '0.7.0'
__version__ = '0.7.1'

from .client import Client
from .errors import *
Expand Down
4 changes: 3 additions & 1 deletion wavelink/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class Client:
"""The main WaveLink client."""

def __new__(cls, *args, **kwargs):
cls.__qualname__ = 'wavelink.Client'

try:
bot = kwargs['bot']
except KeyError:
Expand All @@ -54,7 +56,7 @@ def __new__(cls, *args, **kwargs):
return super().__new__(cls)

for handler in update_handlers:
if isinstance(handler.__self__.__class__, cls.__class__):
if handler.__self__.__class__.__qualname__ == 'wavelink.Client':
bot.remove_listener(handler, 'on_socket_response')

return super().__new__(cls)
Expand Down

0 comments on commit 181fef7

Please sign in to comment.