Fix issue with Callable, Union, and Python 3.9 [mqtt] (#83547)

pull/83377/head
Marc Mueller 2022-12-08 15:42:40 +01:00 committed by GitHub
parent b2edf9b598
commit 25feac1bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -1,8 +1,11 @@
"""Support for MQTT message handling."""
# pylint: disable=deprecated-typing-alias
# In Python 3.9.0 and 3.9.1 collections.abc.Callable
# can't be used inside typing.Union or typing.Optional
from __future__ import annotations
import asyncio
from collections.abc import Callable, Coroutine, Iterable
from collections.abc import Coroutine, Iterable
from functools import lru_cache, partial, wraps
import inspect
from itertools import groupby
@ -10,7 +13,7 @@ import logging
from operator import attrgetter
import ssl
import time
from typing import TYPE_CHECKING, Any, Union, cast
from typing import TYPE_CHECKING, Any, Callable, Union, cast
import uuid
import attr