From 9517c8f4a7efdfe5d014fe32e52723a2447ad549 Mon Sep 17 00:00:00 2001 From: afabiani Date: Mon, 10 Feb 2020 12:32:42 +0100 Subject: [PATCH] [Fixes #8] Preserve python 2.7 back-compatibility --- avatar/templatetags/avatar_tags.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/avatar/templatetags/avatar_tags.py b/avatar/templatetags/avatar_tags.py index 604f2f8..f1e3829 100644 --- a/avatar/templatetags/avatar_tags.py +++ b/avatar/templatetags/avatar_tags.py @@ -1,4 +1,8 @@ -from urllib.parse import urlencode +try: + from urllib.parse import urlencode, urlsplit, urljoin +except ImportError: + from urllib import urlencode + from urlparse import urlsplit, urljoin import hashlib