Skip to content

Commit

Permalink
correctly import Mapping from collections.abc (errbotio#1675)
Browse files Browse the repository at this point in the history
* correctly import Mapping from collections.abc

* docs: add info to CHANGES

---------

Co-authored-by: Sijis Aviles <sijis.aviles@gmail.com>
  • Loading branch information
tgrondier and sijis authored Dec 31, 2023
1 parent dc44e7f commit 9193b1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions errbot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}."
Expand Down

0 comments on commit 9193b1f

Please sign in to comment.