aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-08-22 02:37:40 -0400
committerRapptz <[email protected]>2021-08-22 02:37:40 -0400
commite1e3e298b572ab0544285350eed664d90664c041 (patch)
treec36e018a265c64f02f5abcb6ac44809cc4da91f6
parentMake json conversion functions private (diff)
downloaddiscord.py-e1e3e298b572ab0544285350eed664d90664c041.tar.xz
discord.py-e1e3e298b572ab0544285350eed664d90664c041.zip
Typehint async_context global variable
-rw-r--r--discord/webhook/async_.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py
index 6ee4ce5c..c11090b5 100644
--- a/discord/webhook/async_.py
+++ b/discord/webhook/async_.py
@@ -24,7 +24,6 @@ DEALINGS IN THE SOFTWARE.
from __future__ import annotations
-import contextvars
import logging
import asyncio
import json
@@ -32,6 +31,7 @@ import re
from urllib.parse import quote as urlquote
from typing import Any, Dict, List, Literal, NamedTuple, Optional, TYPE_CHECKING, Tuple, Union, overload
+from contextvars import ContextVar
import aiohttp
@@ -507,7 +507,7 @@ def handle_message_parameters(
return ExecuteWebhookParameters(payload=payload, multipart=multipart, files=files)
-async_context = contextvars.ContextVar('async_webhook_context', default=AsyncWebhookAdapter())
+async_context: ContextVar[AsyncWebhookAdapter] = ContextVar('async_webhook_context', default=AsyncWebhookAdapter())
class PartialWebhookChannel(Hashable):