try to fix crashing

Sat, 01 Jun 2019 12:38:35 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 01 Jun 2019 12:38:35 +0300
changeset 58
86014c443635
parent 57
c147116768f4
child 59
0f3e70a2bb4b

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):
         '''

mercurial