From 9193b1fd3d6a629da707fce4344a10606c0404ba Mon Sep 17 00:00:00 2001 From: tgrondier <5384645+tgrondier@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:14:55 +0100 Subject: [PATCH] correctly import Mapping from collections.abc (#1675) * correctly import Mapping from collections.abc * docs: add info to CHANGES --------- Co-authored-by: Sijis Aviles --- CHANGES.rst | 1 + errbot/cli.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 28e3fe5e2..42488a988 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -43,6 +43,7 @@ fixes: - fix: broken integration tests (#1668) - style: replace format() with f-strings (#1667) - migrate from external mock package to stdlib unittest.mock (#1673) +- fix: import of Mapping from collections.abc (#1675) v6.1.9 (2022-06-11) diff --git a/errbot/cli.py b/errbot/cli.py index 5f36f0330..61934501a 100755 --- a/errbot/cli.py +++ b/errbot/cli.py @@ -83,10 +83,10 @@ def get_config(config_path: str): def _read_dict() -> dict: - import collections + from collections.abc import Mapping new_dict = ast.literal_eval(sys.stdin.read()) - if not isinstance(new_dict, collections.Mapping): + if not isinstance(new_dict, Mapping): raise ValueError( f"A dictionary written in python is needed from stdin. " f"Type={type(new_dict)}, Value = {repr(new_dict)}."