godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

Fix import logic for importing customs list.

Open arcase6 opened this issue 1 year ago • 0 comments

fix import logic for adding files to customs. Current logic always throws exception when trying to append to customs list because Import function has no return.

    #Import function from Scons codebase - does not return anything - merely updates global variables
    def Import(self, *vars):
        try:
            frame = call_stack[-1]
            globals = frame.globals
            exports = frame.exports
            for var in vars:
                var = self.Split(var)
                for v in var:
                    if v == '*':
                        globals.update(global_exports)
                        globals.update(exports)
                    else:
                        if v in exports:
                            globals[v] = exports[v]
                        else:
                            globals[v] = global_exports[v]
        except KeyError as x:
            raise SCons.Errors.UserError("Import of non-existent variable '%s'"%x)     

arcase6 avatar Dec 25 '23 17:12 arcase6