Whenever an oath is required by this code, the affirmation of a person conscientiously scrupulous of taking an oath, shall have the same effect.