Commit d5116352 authored by Vincent A's avatar Vincent A

core: import some stuff from collections.abc (deprecation update)

Since Python 3.3, some imports have moved from collections to
collections.abc but were kept for compatibility, though compatibility
will be dropped in Python 3.10.
We will keep compatibility ourselves for some time again and thus support
both imports.
parent cccff49e
Pipeline #3532 passed with stages
in 15 minutes and 55 seconds
......@@ -23,7 +23,11 @@ import datetime
import re
import unicodedata
import unidecode
from collections import Iterator
try:
# Python 3.3 and above
from collections.abc import Iterator
except ImportError:
from collections import Iterator
from decimal import Decimal, InvalidOperation
from itertools import islice
from numbers import Number
......
......@@ -25,7 +25,11 @@ try:
from ConfigParser import RawConfigParser, DuplicateSectionError
except ImportError:
from configparser import RawConfigParser, DuplicateSectionError
from collections import MutableMapping
try:
# Python 3.3 and above
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
from logging import warning
from subprocess import check_output, CalledProcessError
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment