Do these checks in pure python eagerly.

We get errors in different places, depending on py2k vs. py3k if we don't.