]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Using ABCs from collections instead of collections.abc is deprecated. 609/head
authorJulien Palard <julien@palard.fr>
Tue, 30 Oct 2018 22:50:35 +0000 (23:50 +0100)
committerJulien Palard <julien@palard.fr>
Tue, 30 Oct 2018 22:50:36 +0000 (23:50 +0100)
And it will stop working in Python 3.8 according to the warning.

babel/_compat.py
babel/localedata.py

index 1131f44af1a7c341c9609ec7468d6d6f53c17a6f..849f749e3970686b263e727a1432fadd912c3bf9 100644 (file)
@@ -29,6 +29,7 @@ if not PY2:
     cmp = lambda a, b: (a > b) - (a < b)
 
     array_tobytes = array.array.tobytes
+    from collections import abc
 
 else:
     text_type = unicode
@@ -54,7 +55,7 @@ else:
     cmp = cmp
 
     array_tobytes = array.array.tostring
-
+    import collections as abc
 
 number_types = integer_types + (float,)
 
index a638e58afdea4cb9c82f13d370057e8dcc9d93ea..2a8c4423d4be1ca3c4ac4e6f621a383e3e53d2f6 100644 (file)
 
 import os
 import threading
-from collections import MutableMapping
 from itertools import chain
 
-from babel._compat import pickle, string_types
+from babel._compat import pickle, string_types, abc
 
 
 _cache = {}
@@ -187,7 +186,7 @@ class Alias(object):
         return data
 
 
-class LocaleDataDict(MutableMapping):
+class LocaleDataDict(abc.MutableMapping):
     """Dictionary wrapper that automatically resolves aliases to the actual
     values.
     """