diff --git a/build.py b/build.py index 265f2ebfe..f337c0b5f 100644 --- a/build.py +++ b/build.py @@ -209,8 +209,6 @@ class BuildTarget(): sources = [sources] for s in sources: # Holder unpacking. Ugly. - if hasattr(s, 'glist'): - s = s.glist if hasattr(s, 'held_object'): s = s.held_object if isinstance(s, str): @@ -473,8 +471,8 @@ class BuildTarget(): ids = [] for a in args: # FIXME same hack, forcibly unpack from holder. - if hasattr(a, 'includedirs'): - a = a.includedirs + if hasattr(a, 'held_object'): + a = a.held_object if not isinstance(a, IncludeDirs): raise InvalidArguments('Include directory to be added is not an include directory object.') ids.append(a) @@ -551,8 +549,8 @@ class Generator(): class GeneratedList(): def __init__(self, generator): - if hasattr(generator, 'generator'): - generator = generator.generator + if hasattr(generator, 'held_object'): + generator = generator.held_object self.generator = generator self.infilelist = [] self.outfilelist = [] diff --git a/interpreter.py b/interpreter.py index b1616fbbb..e2a7b16dd 100644 --- a/interpreter.py +++ b/interpreter.py @@ -216,7 +216,7 @@ class GeneratorHolder(InterpreterObject): def __init__(self, interpreter, args, kwargs): super().__init__() self.interpreter = interpreter - self.generator = build.Generator(args, kwargs) + self.held_object = build.Generator(args, kwargs) self.methods.update({'process' : self.process_method}) def process_method(self, args, kwargs): @@ -236,10 +236,10 @@ class GeneratorHolder(InterpreterObject): class GeneratedListHolder(InterpreterObject): def __init__(self, generator): super().__init__() - self.glist = build.GeneratedList(generator) + self.held_object = build.GeneratedList(generator) def add_file(self, a): - self.glist.add_file(a) + self.held_object.add_file(a) class Build(InterpreterObject): def __init__(self): @@ -271,7 +271,7 @@ class Host(InterpreterObject): class IncludeDirsHolder(InterpreterObject): def __init__(self, curdir, dirs, kwargs): super().__init__() - self.includedirs = build.IncludeDirs(curdir, dirs, kwargs) + self.held_object = build.IncludeDirs(curdir, dirs, kwargs) class Headers(InterpreterObject):