Import ABCs from collections.abc

From the deprecation warning message:
"Using or importing the ABCs from 'collections' instead of from
'collections.abc' is deprecated since Python 3.3, and in 3.9 it
will stop working"

Change-Id: I53b11ebe81977d13a460cdf167ba37c5d3e1bdcd
Closes-Bug: #1856882
This commit is contained in:
Rodolfo Alonso Hernandez 2019-12-18 18:07:17 +00:00
parent 185522107a
commit f806dda675
1 changed files with 6 additions and 1 deletions

View File

@ -30,6 +30,11 @@ from oslo_versionedobjects._i18n import _
from oslo_versionedobjects import exception
from oslo_versionedobjects import fields as obj_fields
if six.PY3:
from collections import abc as collections_abc
else:
import collections as collections_abc
LOG = logging.getLogger('object')
@ -790,7 +795,7 @@ class VersionedObjectDictCompat(object):
setattr(self, key, value)
class ObjectListBase(collections.Sequence):
class ObjectListBase(collections_abc.Sequence):
"""Mixin class for lists of objects.
This mixin class can be added as a base class for an object that