Skip to content

Instantly share code, notes, and snippets.

@gorakhargosh
Created June 28, 2011 23:29
Show Gist options
  • Save gorakhargosh/1052499 to your computer and use it in GitHub Desktop.
Save gorakhargosh/1052499 to your computer and use it in GitHub Desktop.
This is the state of urlparse in Python code.
try:
# Python 3.
from urllib.parse import urlparse, urlunparse, parse_qs, quote, unquote_plus
except ImportError:
# Python 2.5+
from urlparse import urlparse, urlunparse
from urllib import quote, unquote_plus
try:
# Python 2.6+
from urlparse import parse_qs
except ImportError:
from cgi import parse_qs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment