mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 09:26:10 +00:00
Normalize type formatting in TypeError
Normalize most mixed usages of `__class__`, `__class__!r`, `__class__.__name__!r` to the standard form of `__class__.__name__`
This commit is contained in:
@ -649,7 +649,7 @@ class SyncWebhook(BaseWebhook):
|
||||
|
||||
if session is not MISSING:
|
||||
if not isinstance(session, requests.Session):
|
||||
raise TypeError(f'expected requests.Session not {session.__class__!r}')
|
||||
raise TypeError(f'expected requests.Session not {session.__class__.__name__}')
|
||||
else:
|
||||
session = requests # type: ignore
|
||||
return cls(data, session, token=bot_token)
|
||||
@ -692,7 +692,7 @@ class SyncWebhook(BaseWebhook):
|
||||
|
||||
if session is not MISSING:
|
||||
if not isinstance(session, requests.Session):
|
||||
raise TypeError(f'expected requests.Session not {session.__class__!r}')
|
||||
raise TypeError(f'expected requests.Session not {session.__class__.__name__}')
|
||||
else:
|
||||
session = requests # type: ignore
|
||||
return cls(data, session, token=bot_token) # type: ignore
|
||||
|
Reference in New Issue
Block a user