Should try/except rather than testing None as per my comment - due to new behaviour.