Skip to content

Commit

Permalink
Remove unicode encoding for HTTP method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Scrivner committed Dec 17, 2012
1 parent 916e6fc commit 8c01865
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions requests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
guess_json_utf)
from .compat import (
cookielib, urlparse, urlunparse, urljoin, urlsplit, urlencode, str, bytes,
StringIO, is_py2, chardet, json, builtin_str, urldefrag, basestring)
StringIO, is_py2, is_py3, chardet, json, builtin_str, urldefrag, basestring)

REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)
CONTENT_CHUNK_SIZE = 10 * 1024
Expand Down Expand Up @@ -222,13 +222,9 @@ def __repr__(self):

def prepare_method(self, method):
"""Prepares the given HTTP method."""
try:
method = unicode(method)
except NameError:
# We're on Python 3.
method = str(method)

self.method = method.upper()
self.method = method
if self.method is not None:
self.method = self.method.upper()

def prepare_url(self, url, params):
"""Prepares the given HTTP URL."""
Expand Down

0 comments on commit 8c01865

Please sign in to comment.