Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/+88885c50.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent deprecation warning for ``PersistentDict``: use ``PersistentMapping``. [maurits]
6 changes: 3 additions & 3 deletions src/plone/scale/storage.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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:
Expand Down