"""
import socket as _socket
-import urlparse as _urlparse
+try: # Python 3
+ import urllib.parse as _urllib_parse
+except ImportError: # Python 2
+ import urlparse as _urllib_parse
__version__ = '0.1'
# as $request_uri is what was originally sent by the browser
# before any such modifications. Does not include the protocol
# or host name. Example: /foo/bar.html
- scheme,netloc,path,params,query,fragment = _urlparse.urlparse(uri)
+ scheme,netloc,path,params,query,fragment = _urllib_parse.urlparse(uri)
# <scheme>://<netloc>/<path>;<params>?<query>#<fragment>
scheme = netloc = ''
- request_uri = _urlparse.urlunparse(
+ request_uri = _urllib_parse.urlunparse(
(scheme, netloc, path, params, query, fragment))
document_uri = path
strings = [