Conditionally import urlparse for Py3 support