Thrift-1604:Python exxception handeling for changes from PEP3110
Client: py
Patch: Jake Farrell
Python PEP 3110 changed exception handling by replacing the ',' with 'as'. This was initially introduced in python 2.6 and in 3.0 the ',' usage is no longer suppported. Since exception handling through out the py lib uses the ',' it will need to be converted over to using the 'as' syntax for exceptions
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1339941 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/py/src/transport/TSSLSocket.py b/lib/py/src/transport/TSSLSocket.py
index 6d79ac6..e0ff4f9 100644
--- a/lib/py/src/transport/TSSLSocket.py
+++ b/lib/py/src/transport/TSSLSocket.py
@@ -86,13 +86,13 @@
self.handle.settimeout(self._timeout)
try:
self.handle.connect(ip_port)
- except socket.error, e:
+ except socket.error as e:
if res is not res0[-1]:
continue
else:
raise e
break
- except socket.error, e:
+ except socket.error as e:
if self._unix_socket:
message = 'Could not connect to secure socket %s' % self._unix_socket
else:
@@ -188,7 +188,7 @@
try:
client = ssl.wrap_socket(plain_client, certfile=self.certfile,
server_side=True, ssl_version=self.SSL_VERSION)
- except ssl.SSLError, ssl_exc:
+ except ssl.SSLError as ssl_exc:
# failed handshake/ssl wrap, close socket to client
plain_client.close()
# raise ssl_exc