mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Import collections abstract base classes from collections.abc (#15649)
Accessing them directly through collections is deprecated since 3.7, and will no longer work in 3.8.
This commit is contained in:
parent
cbb5d34167
commit
397f551e6d
@ -1,5 +1,5 @@
|
||||
"""Support for Google Assistant Smart Home API."""
|
||||
import collections
|
||||
from collections.abc import Mapping
|
||||
from itertools import product
|
||||
import logging
|
||||
|
||||
@ -50,7 +50,7 @@ DOMAIN_TO_GOOGLE_TYPES = {
|
||||
def deep_update(target, source):
|
||||
"""Update a nested dictionary with another nested dictionary."""
|
||||
for key, value in source.items():
|
||||
if isinstance(value, collections.Mapping):
|
||||
if isinstance(value, Mapping):
|
||||
target[key] = deep_update(target.get(key, {}), value)
|
||||
else:
|
||||
target[key] = value
|
||||
|
@ -5,7 +5,7 @@ For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/notify.group/
|
||||
"""
|
||||
import asyncio
|
||||
import collections
|
||||
from collections.abc import Mapping
|
||||
from copy import deepcopy
|
||||
import logging
|
||||
import voluptuous as vol
|
||||
@ -33,7 +33,7 @@ def update(input_dict, update_source):
|
||||
Async friendly.
|
||||
"""
|
||||
for key, val in update_source.items():
|
||||
if isinstance(val, collections.Mapping):
|
||||
if isinstance(val, Mapping):
|
||||
recurse = update(input_dict.get(key, {}), val)
|
||||
input_dict[key] = recurse
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user