filecache.py

changeset 58
86014c443635
parent 54
0c686d10eb49
child 92
b8d72909d593
--- 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