When the reason alleged for not pronouncing sentence is that the person brought before the court to be sentenced is not the person against whom the verdict was rendered, or that the defendant has been pardoned of the offense charged, the court shall postpone the pronouncement of judgment, if necessary, for the purpose of hearing evidence relating to the identity or pardon of such person, and on proof of nonidentity or pardon, as the case may be, shall discharge such person from custody, unless the person is in custody on some other charge.
N.D.C.C. § 29-26-14