Use collections.abc.Iterable instead of collections.Iterable

The latter is going to be removed after Python 3.8
This commit is contained in:
Swen Kooij
2019-08-14 08:57:05 +03:00
parent 946e9a67c4
commit 3de1492a58
3 changed files with 27 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
import deprecation
import collections
from typing import Optional
from collections.abc import Iterable
from django.conf import settings
from django.utils import translation
@@ -97,7 +98,7 @@ class LocalizedValue(dict):
lang_value = value.get(lang_code, self.default_value)
self.set(lang_code, lang_value)
elif isinstance(value, collections.Iterable):
elif isinstance(value, Iterable):
for val in value:
self._interpret_value(val)