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

Redo "Import abstract base classes from collection.abc in python 3.3+" #54834

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 5 additions & 1 deletion salt/modules/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
import glob
import hashlib
import mmap
from collections import Iterable, Mapping, namedtuple
try:
from collections.abc import Iterable, Mapping
except ImportError:
from collections import Iterable, Mapping
from collections import namedtuple
from functools import reduce # pylint: disable=redefined-builtin

# pylint: disable=import-error,no-name-in-module,redefined-builtin
Expand Down
5 changes: 4 additions & 1 deletion salt/modules/win_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
import logging
# pylint: disable=W0611
import operator # do not remove
from collections import Iterable, Mapping # do not remove
try:
from collections.abc import Iterable, Mapping # do not remove
except ImportError:
from collections import Iterable, Mapping # do not remove
from functools import reduce # do not remove
import datetime # do not remove.
import tempfile # do not remove. Used in salt.modules.file.__clean_tmp
Expand Down
6 changes: 5 additions & 1 deletion salt/states/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ def run():
import sys
import time
import traceback
from collections import Iterable, Mapping, defaultdict
from collections import defaultdict
try:
from collections.abc import Iterable, Mapping
except ImportError:
from collections import Iterable, Mapping
from datetime import datetime, date # python3 problem in the making?

# Import salt libs
Expand Down
5 changes: 4 additions & 1 deletion salt/utils/dictdiffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
'''
from __future__ import absolute_import, print_function, unicode_literals
import copy
from collections import Mapping
try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping
from salt.ext import six


Expand Down