Backports additional code for python 2.6.
Fixes URLInfo scheme detection for Python 2.6.