mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-02-17 02:30:47 +01:00
Update akismet code for python 3, to address #607
This commit is contained in:
parent
ff95fa5d6a
commit
a361e76999
@ -12,6 +12,9 @@
|
|||||||
# Released subject to the BSD License
|
# Released subject to the BSD License
|
||||||
# See http://www.voidspace.org.uk/python/license.shtml
|
# 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 <http://akismet.com>`_ API.
|
A python interface to the `Akismet <http://akismet.com>`_ API.
|
||||||
@ -56,7 +59,10 @@ Usage example::
|
|||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from urllib import urlencode
|
try:
|
||||||
|
from urllib import urlencode # python2
|
||||||
|
except ImportError:
|
||||||
|
from urllib.parse import urlencode # python3
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
if hasattr(socket, 'setdefaulttimeout'):
|
if hasattr(socket, 'setdefaulttimeout'):
|
||||||
|
Loading…
Reference in New Issue
Block a user