Skip to content

Commit

Permalink
Make urlencode load properly in python 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen McMillen committed Nov 14, 2014
1 parent 14762a7 commit f04e32c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions vimeo/auth/authorization_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@

from __future__ import absolute_import

import urllib
from .base import AuthenticationMixinBase
from . import GrantFailed

# We need to get urlencode from urllib.parse in Python 3, but fall back to
# urllib in Python 2
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode

try:
basestring
except NameError:
Expand All @@ -33,7 +39,7 @@ def auth_url(self, scope, redirect):
if redirect:
query['redirect_uri'] = redirect

return url + urllib.urlencode(query)
return url + urlencode(query)

def exchange_code(self, code, redirect):
"""Perform the exchange step for the code from the redirected user."""
Expand Down

0 comments on commit f04e32c

Please sign in to comment.