private void AddReference(Assembly assembly) { Tuple referencesTuple = References as Tuple; if (referencesTuple == null) { throw Ops.TypeError("cannot add reference"); } // Load the assembly into IronPython if (state.TopPackage.LoadAssembly(state, assembly)) { // Add it to the references tuple if we // loaded a new assembly. References = referencesTuple.AddSequence(Tuple.MakeTuple(assembly)); } }