Make add_nodes_from compatible with IronPython