Move gi.histories.wait() to gi._wait_datasets() .