From a189d42328a5e0a90f29651bf725cb8d8fd0d550 Mon Sep 17 00:00:00 2001 From: Joe R Date: Tue, 11 Jun 2024 17:48:13 -0400 Subject: [PATCH] Fixed incompatibility error with string types on older versions of Python. --- pysollib/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pysollib/util.py b/pysollib/util.py index bc577655..10965fd2 100644 --- a/pysollib/util.py +++ b/pysollib/util.py @@ -37,6 +37,8 @@ from pysollib.mfxutil import Image from pysollib.mygettext import _ from pysollib.settings import DATA_DIRS, TOOLKIT +import six + # ************************************************************************ # * constants # ************************************************************************ @@ -149,8 +151,8 @@ class DataLoader: def __findFile(self, func, filename, subdirs=None, do_raise=1): if subdirs is None: subdirs = ("",) - elif isinstance(subdirs, str): - subdirs = (subdirs,) + elif isinstance(subdirs, six.string_types): + subdirs = (str(subdirs),) for dir in subdirs: f = os.path.join(self.dir, dir, filename) f = os.path.normpath(f)