BF: numpy.asarray was being called without numpy being imported

This was creating a NameError exception, which then wasn't being caught and was manifesting as a UnboundLocalError in the finally branch.