From a361e769999172b0d7ef37f581c16884c6d7ee29 Mon Sep 17 00:00:00 2001 From: Garret Wassermann Date: Fri, 20 Apr 2018 03:27:26 -0400 Subject: [PATCH] Update akismet code for python 3, to address #607 --- helpdesk/akismet.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/helpdesk/akismet.py b/helpdesk/akismet.py index 9a99c881..31564b92 100644 --- a/helpdesk/akismet.py +++ b/helpdesk/akismet.py @@ -12,6 +12,9 @@ # Released subject to the BSD License # See http://www.voidspace.org.uk/python/license.shtml +# Updated by django-helpdesk developers, 2018 +# to be compatible with python 3 + """ A python interface to the `Akismet `_ API. @@ -56,7 +59,10 @@ Usage example:: import os -from urllib import urlencode +try: + from urllib import urlencode # python2 +except ImportError: + from urllib.parse import urlencode # python3 import socket if hasattr(socket, 'setdefaulttimeout'):