public PythonModule load_module(CodeContext /*!*/ context, string fullName) { PythonContext pc = PythonContext.GetContext(context); CodeContext newContext = _sc.CreateContext(); newContext.ModuleContext.InitializeBuiltins(false); pc.InitializeModule(_sc.SourceUnit.Path, newContext.ModuleContext, _sc, ModuleOptions.Initialize); if (_parentName != null) { // if we are a module in a package update the parent package w/ our scope. object parent; if (pc.SystemStateModules.TryGetValue(_parentName, out parent)) { PythonModule s = parent as PythonModule; if (s != null) { s.__dict__[_name] = newContext.ModuleContext.Module; } } } return(newContext.ModuleContext.Module); }