1
0
Fork 0
forked from github/pelican

fix testing failures

when settings could be pathlib.Path
This commit is contained in:
MinchinWeb 2020-04-23 13:47:10 -06:00
commit cfba3d72be
6 changed files with 58 additions and 39 deletions

View file

@ -1,6 +1,7 @@
import functools
import logging
import os
import pathlib
from pelican.utils import slugify
@ -110,6 +111,8 @@ class URLWrapper:
"""
setting = "{}_{}".format(self.__class__.__name__.upper(), key)
value = self.settings[setting]
if isinstance(value, pathlib.Path):
value = str(value)
if not isinstance(value, str):
logger.warning('%s is set to %s', setting, value)
return value