Skip to content
Snippets Groups Projects
Commit 4708e507 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

MNT: Accept pathlib.Path, normalise to string for image cache keys. All other

eval routines should already be compatible
parent dd37b51c
No related branches found
No related tags found
1 merge request!41BF,RF: Fix a few bugs, adjust `evalHeader` routine
...@@ -77,7 +77,7 @@ class ImageCache: ...@@ -77,7 +77,7 @@ class ImageCache:
returned value will be ``None``. returned value will be ``None``.
""" """
imagefile = op.realpath(op.abspath(imagefile)) imagefile = str(op.realpath(op.abspath(imagefile)))
image = self.__images.get(imagefile, None) image = self.__images.get(imagefile, None)
if image is not None: if image is not None:
...@@ -108,7 +108,7 @@ class ImageCache: ...@@ -108,7 +108,7 @@ class ImageCache:
# it in this way because all keys # it in this way because all keys
# passed to __getitem__ get # passed to __getitem__ get
# transformed in the same way. # transformed in the same way.
imagefile = op.realpath(op.abspath(imagefile)) imagefile = str(op.realpath(op.abspath(imagefile)))
imagesize = size(image) imagesize = size(image)
self.__images[ imagefile] = image, data self.__images[ imagefile] = image, data
self.__imagesizes[imagefile] = imagesize self.__imagesizes[imagefile] = imagesize
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment