Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Mapping function from collections.abc to comply with Python 3.10 #854

Merged
merged 4 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pcmdi_metrics/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import logging
import os
import re
from collections import Mapping, OrderedDict
from collections import OrderedDict
from collections.abc import Mapping

import cdat_info
import cdms2
Expand Down
4 changes: 2 additions & 2 deletions pcmdi_metrics/mjo/lib/dict_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
# Modifed by Jiwoo Lee, 2020-06-26: Skip merging when dict is empty

import collections
from collections.abc import Mapping


def dict_merge(dct, merge_dct):
Expand All @@ -36,7 +36,7 @@ def dict_merge(dct, merge_dct):
if (
k in dct
and isinstance(dct[k], dict)
and isinstance(merge_dct[k], collections.Mapping)
and isinstance(merge_dct[k], Mapping)
):
dict_merge(dct[k], merge_dct[k])
else:
Expand Down
4 changes: 2 additions & 2 deletions pcmdi_metrics/variability_mode/lib/dict_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import collections
from collections.abc import Mapping


def dict_merge(dct, merge_dct):
Expand All @@ -32,7 +32,7 @@ def dict_merge(dct, merge_dct):
if (
k in dct
and isinstance(dct[k], dict)
and isinstance(merge_dct[k], collections.Mapping)
and isinstance(merge_dct[k], Mapping)
):
dict_merge(dct[k], merge_dct[k])
else:
Expand Down