diff options
author | Hugo <hugovk@users.noreply.github.com> | 2019-08-14 23:35:36 +0300 |
---|---|---|
committer | Hugo <hugovk@users.noreply.github.com> | 2019-08-15 12:24:33 +0300 |
commit | 3718a0e048e64994c2ee3819c5e5ed218a05f115 (patch) | |
tree | 38b56eba3e23b5c20af0a09a6a860ecc279dc067 /oauthlib/oauth1 | |
parent | ddc953c11e8d79607f5931a2f80dcd9f7a10c5d9 (diff) | |
download | oauthlib-3718a0e048e64994c2ee3819c5e5ed218a05f115.tar.gz |
Drop support for legacy Python 2.7
Diffstat (limited to 'oauthlib/oauth1')
-rw-r--r-- | oauthlib/oauth1/rfc5849/signature.py | 7 | ||||
-rw-r--r-- | oauthlib/oauth1/rfc5849/utils.py | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/oauthlib/oauth1/rfc5849/signature.py b/oauthlib/oauth1/rfc5849/signature.py index a60bee2..5b080aa 100644 --- a/oauthlib/oauth1/rfc5849/signature.py +++ b/oauthlib/oauth1/rfc5849/signature.py @@ -28,8 +28,7 @@ import hashlib import hmac import logging -from oauthlib.common import (extract_params, safe_string_equals, - unicode_type, urldecode) +from oauthlib.common import extract_params, safe_string_equals, urldecode from . import utils @@ -128,7 +127,7 @@ def base_string_uri(uri, host=None): The host argument overrides the netloc part of the uri argument. """ - if not isinstance(uri, unicode_type): + if not isinstance(uri, str): raise ValueError('uri must be a unicode object.') # FIXME: urlparse does not support unicode @@ -577,7 +576,7 @@ def sign_rsa_sha1(base_string, rsa_private_key): .. _`RFC3447, Section 8.2`: https://tools.ietf.org/html/rfc3447#section-8.2 """ - if isinstance(base_string, unicode_type): + if isinstance(base_string, str): base_string = base_string.encode('utf-8') # TODO: finish RSA documentation alg = _jwt_rs1_signing_algorithm() diff --git a/oauthlib/oauth1/rfc5849/utils.py b/oauthlib/oauth1/rfc5849/utils.py index 735f21d..a010aea 100644 --- a/oauthlib/oauth1/rfc5849/utils.py +++ b/oauthlib/oauth1/rfc5849/utils.py @@ -8,7 +8,7 @@ spec. """ from __future__ import absolute_import, unicode_literals -from oauthlib.common import quote, unicode_type, unquote +from oauthlib.common import quote, unquote try: import urllib2 @@ -52,7 +52,7 @@ def escape(u): .. _`section 3.6`: https://tools.ietf.org/html/rfc5849#section-3.6 """ - if not isinstance(u, unicode_type): + if not isinstance(u, str): raise ValueError('Only unicode objects are escapable. ' + 'Got %r of type %s.' % (u, type(u))) # Letters, digits, and the characters '_.-' are already treated as safe @@ -61,7 +61,7 @@ def escape(u): def unescape(u): - if not isinstance(u, unicode_type): + if not isinstance(u, str): raise ValueError('Only unicode objects are unescapable.') return unquote(u) |