Skip to content

Commit

Permalink
Consume collections abc classes from correct module
Browse files Browse the repository at this point in the history
As noted in the Python documentation [0], abstract members of the
`collections` module was moved to `collections.abc` in Python 3.3
and scheduled for removal in Python 3.10.

0: https://docs.python.org/3.9/library/collections.html
(cherry picked from commit 5e9216a)
  • Loading branch information
fnordahl authored and Corey Bryant committed Dec 8, 2023
1 parent 59811f3 commit 2c2f42c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zaza/charm_lifecycle/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _concat_model_alias_maps(data):
"""
new_data = {DEFAULT_MODEL_ALIAS: []}
for item in data:
if isinstance(item, collections.Mapping):
if isinstance(item, collections.abc.Mapping):
new_data.update(item)
else:
new_data[DEFAULT_MODEL_ALIAS].append(item)
Expand Down Expand Up @@ -151,7 +151,7 @@ def get_deployment_type(deployment_directive):
"""
if isinstance(deployment_directive, str):
return RAW_BUNDLE
if isinstance(deployment_directive, collections.Mapping):
if isinstance(deployment_directive, collections.abc.Mapping):
if len(deployment_directive) == 1:
first_value = deployment_directive[list(deployment_directive)[0]]
if isinstance(first_value, list):
Expand Down

0 comments on commit 2c2f42c

Please sign in to comment.