diff --git a/news/+88885c50.bugfix.rst b/news/+88885c50.bugfix.rst new file mode 100644 index 0000000..a8b9cd4 --- /dev/null +++ b/news/+88885c50.bugfix.rst @@ -0,0 +1 @@ +Prevent deprecation warning for ``PersistentDict``: use ``PersistentMapping``. [maurits] diff --git a/src/plone/scale/storage.py b/src/plone/scale/storage.py index 92ceb8b..6c439c7 100644 --- a/src/plone/scale/storage.py +++ b/src/plone/scale/storage.py @@ -1,7 +1,7 @@ from .scale import calculate_scaled_dimensions from .scale import get_scale_mode from collections.abc import MutableMapping -from persistent.dict import PersistentDict +from persistent.mapping import PersistentMapping from plone.scale.interfaces import IImageScaleFactory from time import time from ZODB.POSException import ConflictError @@ -71,7 +71,7 @@ def get_or_generate(uid): """ -class ScalesDict(PersistentDict): +class ScalesDict(PersistentMapping): def raise_conflict(self, saved, new): logger.info("Conflict") logger.debug("saved\n" + pprint.pformat(saved)) @@ -179,7 +179,7 @@ def storage(self): safeWrite(self.context) scales = annotations["plone.scale"] if not isinstance(scales, ScalesDict): - # migrate from PersistentDict to ScalesDict + # migrate from PersistentMapping to ScalesDict new_scales = ScalesDict(scales) annotations["plone.scale"] = new_scales if safeWrite is not None: