From 397f551e6d168cfe16919296acc9281c1ecd6e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 25 Jul 2018 12:35:22 +0300 Subject: [PATCH] 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. --- homeassistant/components/google_assistant/smart_home.py | 4 ++-- homeassistant/components/notify/group.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/google_assistant/smart_home.py b/homeassistant/components/google_assistant/smart_home.py index 927139a483e..63a3e641170 100644 --- a/homeassistant/components/google_assistant/smart_home.py +++ b/homeassistant/components/google_assistant/smart_home.py @@ -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 diff --git a/homeassistant/components/notify/group.py b/homeassistant/components/notify/group.py index a98bb6c2317..94856c730b1 100644 --- a/homeassistant/components/notify/group.py +++ b/homeassistant/components/notify/group.py @@ -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: