Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix py3 setup exceptions #36

Open
wants to merge 1 commit into from

2 participants

@Pentusha

No description provided.

@svisser

These changes are also part of a Python 2.x / 3.x compatibility pull request: #63.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 26, 2013
  1. @Pentusha
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +3 −3 gearman/connection.py
  2. +1 −1  gearman/util.py
View
6 gearman/connection.py
@@ -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)
@@ -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:
@@ -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:
View
2  gearman/util.py
@@ -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
Something went wrong with that request. Please try again.