Fix urlparse import to support both Py2 and Py3.