Make SOCKS-proxy support global for all queues under Py3

Python 2 retains per-queue SOCKS-proxy support, but this is simplest fix until someone needs it for Python 3.
This commit is contained in:
Jonathan Barratt
2017-01-13 17:06:11 +07:00
parent 719b03f186
commit b5feeb7ee9
2 changed files with 3 additions and 7 deletions

View File

@@ -126,12 +126,8 @@ def process_queue(q, logger):
addr=q.socks_proxy_host,
port=q.socks_proxy_port)
socket.socket = socks.socksocket
else:
if six.PY2:
socket.socket = socket._socketobject
elif six.PY3:
import _socket
socket.socket = _socket.socket
elif six.PY2:
socket.socket = socket._socketobject
email_box_type = settings.QUEUE_EMAIL_BOX_TYPE or q.email_box_type