Sat, 01 Jun 2019 12:38:35 +0300
try to fix crashing
filecache.py | file | annotate | diff | comparison | revisions |
--- a/filecache.py Sat Jun 01 10:48:03 2019 +0300 +++ b/filecache.py Sat Jun 01 12:38:35 2019 +0300 @@ -41,10 +41,14 @@ Initializes a new subfile cache ''' self.cache = dict() - self.ldraw_directories = [ - Path(os.path.expanduser(directory)) - for directory in ldraw_directories - ] + if ldraw_directories and isinstance(ldraw_directories[0], str): + self.ldraw_directories = [ + Path(os.path.expanduser(directory)) + for directory in ldraw_directories + ] + else: + from copy import copy + self.ldraw_directories = copy(ldraw_directories) self.reference_stack = [] def flatness_of(self, filename): '''