Let data_directory take an existing pathclass instance.

This commit is contained in:
voussoir 2020-09-27 10:45:58 -07:00
parent a2fc49b6e7
commit 51b2642be9

View file

@ -1693,7 +1693,8 @@ class PhotoDB(
else: else:
data_directory = constants.DEFAULT_DATADIR data_directory = constants.DEFAULT_DATADIR
data_directory = helpers.remove_path_badchars(data_directory, allowed=':/\\') if isinstance(data_directory, str):
data_directory = helpers.remove_path_badchars(data_directory, allowed=':/\\')
self.data_directory = pathclass.Path(data_directory) self.data_directory = pathclass.Path(data_directory)
if self.data_directory.exists and not self.data_directory.is_dir: if self.data_directory.exists and not self.data_directory.is_dir: