From 43fdeaedd312bd70c7fa49c6a09cd0faf23e4a86 Mon Sep 17 00:00:00 2001 From: Hammy Goonan Date: Mon, 11 Jan 2016 10:07:45 -0600 Subject: [PATCH 1/2] changing urljoin import for Python3 compatability. --- flask_oauth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_oauth.py b/flask_oauth.py index b21105a..c3f6d1d 100644 --- a/flask_oauth.py +++ b/flask_oauth.py @@ -10,7 +10,7 @@ """ import httplib2 from functools import wraps -from urlparse import urljoin +from urllib.parse import urljoin from flask import request, session, json, redirect, Response from werkzeug import url_decode, url_encode, url_quote, \ parse_options_header, Headers From 8a4b98719704929d39adaa7b33ff17a52d0737c1 Mon Sep 17 00:00:00 2001 From: Hammy Goonan Date: Mon, 11 Jan 2016 10:16:47 -0600 Subject: [PATCH 2/2] adding check for Python version before importing urljoin for Python3 compatibility. --- flask_oauth.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flask_oauth.py b/flask_oauth.py index c3f6d1d..7d1b6db 100644 --- a/flask_oauth.py +++ b/flask_oauth.py @@ -8,14 +8,21 @@ :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ +import sys import httplib2 from functools import wraps -from urllib.parse import urljoin from flask import request, session, json, redirect, Response from werkzeug import url_decode, url_encode, url_quote, \ parse_options_header, Headers import oauth2 +if (sys.version_info > (3, 0)): + # Python3 import + from urllib.parse import urljoin +else: + # Python2 import + from urlparse import urljoin + _etree = None def get_etree():