Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

Fix py3 setup exceptions #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gearman/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _create_client_socket(self):
try:
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect((self.gearman_host, self.gearman_port))
except socket.error, socket_exception:
except socket.error as socket_exception:
self.throw_exception(exception=socket_exception)

self.set_socket(client_socket)
Expand Down Expand Up @@ -144,7 +144,7 @@ def read_data_from_socket(self, bytes_to_read=4096):
recv_buffer = ''
try:
recv_buffer = self.gearman_socket.recv(bytes_to_read)
except socket.error, socket_exception:
except socket.error as socket_exception:
self.throw_exception(exception=socket_exception)

if len(recv_buffer) == 0:
Expand Down Expand Up @@ -203,7 +203,7 @@ def send_data_to_socket(self):

try:
bytes_sent = self.gearman_socket.send(self._outgoing_buffer)
except socket.error, socket_exception:
except socket.error as socket_exception:
self.throw_exception(exception=socket_exception)

if bytes_sent == 0:
Expand Down
2 changes: 1 addition & 1 deletion gearman/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def select(rlist, wlist, xlist, timeout=None):

try:
rd_list, wr_list, ex_list = select_lib.select(*select_args)
except select_lib.error, exc:
except select_lib.error as exc:
# Ignore interrupted system call, reraise anything else
if exc[0] != errno.EINTR:
raise
Expand Down