diff options
Diffstat (limited to 'oauthlib/oauth2/rfc6749')
-rw-r--r-- | oauthlib/oauth2/rfc6749/parameters.py | 6 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/tokens.py | 5 | ||||
-rw-r--r-- | oauthlib/oauth2/rfc6749/utils.py | 11 |
3 files changed, 4 insertions, 18 deletions
diff --git a/oauthlib/oauth2/rfc6749/parameters.py b/oauthlib/oauth2/rfc6749/parameters.py index a3f9dd0..2bca4d2 100644 --- a/oauthlib/oauth2/rfc6749/parameters.py +++ b/oauthlib/oauth2/rfc6749/parameters.py @@ -15,6 +15,7 @@ import time from oauthlib.common import add_params_to_qs, add_params_to_uri from oauthlib.signals import scope_changed +import urllib.parse as urlparse from .errors import (InsecureTransportError, MismatchingStateError, MissingCodeError, MissingTokenError, @@ -22,11 +23,6 @@ from .errors import (InsecureTransportError, MismatchingStateError, from .tokens import OAuth2Token from .utils import is_secure_transport, list_to_scope, scope_to_list -try: - import urlparse -except ImportError: - import urllib.parse as urlparse - def prepare_grant_uri(uri, client_id, response_type, redirect_uri=None, scope=None, state=None, **kwargs): diff --git a/oauthlib/oauth2/rfc6749/tokens.py b/oauthlib/oauth2/rfc6749/tokens.py index 8873ed5..8e139f6 100644 --- a/oauthlib/oauth2/rfc6749/tokens.py +++ b/oauthlib/oauth2/rfc6749/tokens.py @@ -16,13 +16,10 @@ import warnings from oauthlib import common from oauthlib.common import add_params_to_qs, add_params_to_uri +from urllib.parse import urlparse from . import utils -try: - from urlparse import urlparse -except ImportError: - from urllib.parse import urlparse class OAuth2Token(dict): diff --git a/oauthlib/oauth2/rfc6749/utils.py b/oauthlib/oauth2/rfc6749/utils.py index 7516c9e..efbf8aa 100644 --- a/oauthlib/oauth2/rfc6749/utils.py +++ b/oauthlib/oauth2/rfc6749/utils.py @@ -11,15 +11,8 @@ import datetime import os from oauthlib.common import urldecode - -try: - from urllib import quote -except ImportError: - from urllib.parse import quote -try: - from urlparse import urlparse -except ImportError: - from urllib.parse import urlparse +from urllib.parse import quote +from urllib.parse import urlparse def list_to_scope(scope): |