more stuff and things

This commit is contained in:
Kenneth Reitz
2012-01-23 00:52:38 -05:00
parent 11c4315da3
commit fe6882623c
2 changed files with 7 additions and 8 deletions
+4 -1
View File
@@ -79,13 +79,16 @@ is_solaris = ('solar==' in str(sys.platform).lower()) # Complete guess.
if is_py2:
from urlparse import urlparse, urlunparse, urljoin, urlsplit, quote, unquote
from urllib import quote, unquote
from urlparse import urlparse, urlunparse, urljoin, urlsplit
from urllib2 import parse_http_list
import cookielib
from .packages.oreos.monkeys import SimpleCookie
elif is_py3:
from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote
from urllib.request import parse_http_list
from http import cookiejar as cookielib
from http.cookies import SimpleCookie
+3 -7
View File
@@ -8,16 +8,12 @@ This module contains the primary objects that power Requests.
"""
import os
import urllib.request, urllib.parse, urllib.error
# from urlparse import urlparse, urlunparse, urljoin, urlsplit
from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode
from datetime import datetime
from .hooks import dispatch_hook, HOOKS
from .structures import CaseInsensitiveDict
from .status_codes import codes
# from .packages import oreos
from .auth import HTTPBasicAuth, HTTPProxyAuth
from .packages.urllib3.response import HTTPResponse
from .packages.urllib3.exceptions import MaxRetryError
@@ -32,6 +28,8 @@ from .utils import (
get_encoding_from_headers, stream_decode_response_unicode,
stream_decompress, guess_filename, requote_path, dict_from_string)
from .compat import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote
# Import chardet if it is available.
try:
import chardet
@@ -356,8 +354,6 @@ class Request(object):
if not path:
path = '/'
from urllib.parse import quote, unquote
path = quote(path.encode('utf-8'))
url.append(path)