Resolve included files only once
authorJeremy Stanley <fungi@yuggoth.org>
Mon, 16 Jul 2018 03:12:50 +0000 (03:12 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Mon, 16 Jul 2018 03:12:50 +0000 (03:12 +0000)
Remove an unnecessary additional round of included file resolution
and rely on the one which happens once the parent file has been
completely loaded. This was causing a startup race which would
sometimes result in the configured search path to not get applied
depending on initial config file load order, because it would
prematurely attempt to resolve included files before the configured
search path was loaded.

mudpy/data.py

index 6371045..be88d65 100644 (file)
@@ -74,13 +74,7 @@ class Data:
         includes = []
         for node in list(self.data):
             if node == "_load":
         includes = []
         for node in list(self.data):
             if node == "_load":
-                for included in self.data["_load"]:
-                    included = find_file(
-                        included,
-                        relative=self.source,
-                        universe=self.universe)
-                    if included not in includes:
-                        includes.append(included)
+                includes += self.data["_load"]
                 continue
             if node.startswith("_"):
                 continue
                 continue
             if node.startswith("_"):
                 continue