Thrift-1784: pep-3110 exception handling
Client: py
Patch: jfarrell

Updates python lib for pep-3110
diff --git a/lib/py/src/server/THttpServer.py b/lib/py/src/server/THttpServer.py
index be54bab..6f92173 100644
--- a/lib/py/src/server/THttpServer.py
+++ b/lib/py/src/server/THttpServer.py
@@ -73,7 +73,7 @@
         oprot = thttpserver.outputProtocolFactory.getProtocol(otrans)
         try:
           thttpserver.processor.process(iprot, oprot)
-        except ResponseException, exn:
+        except ResponseException as exn:
           exn.handler(self)
         else:
           self.send_response(200)
diff --git a/lib/py/src/server/TProcessPoolServer.py b/lib/py/src/server/TProcessPoolServer.py
index eefb623..ae7fe1c 100644
--- a/lib/py/src/server/TProcessPoolServer.py
+++ b/lib/py/src/server/TProcessPoolServer.py
@@ -63,7 +63,7 @@
                 self.serveClient(client)
             except (KeyboardInterrupt, SystemExit):
                 return 0
-            except Exception, x:
+            except Exception as x:
                 logger.exception(x)
 
     def serveClient(self, client):
@@ -76,9 +76,9 @@
         try:
             while True:
                 self.processor.process(iprot, oprot)
-        except TTransportException, tx:
+        except TTransportException as tx:
             pass
-        except Exception, x:
+        except Exception as x:
             logger.exception(x)
 
         itrans.close()
@@ -99,7 +99,7 @@
                 w.daemon = True
                 w.start()
                 self.workers.append(w)
-            except Exception, x:
+            except Exception as x:
                 logger.exception(x)
 
         # wait until the condition is set by stop()
@@ -110,7 +110,7 @@
                 break
             except (SystemExit, KeyboardInterrupt):
                 break
-            except Exception, x:
+            except Exception as x:
                 logger.exception(x)
 
         self.isRunning.value = False
diff --git a/lib/py/src/server/TServer.py b/lib/py/src/server/TServer.py
index 00fd8cf..8c58e39 100644
--- a/lib/py/src/server/TServer.py
+++ b/lib/py/src/server/TServer.py
@@ -86,9 +86,9 @@
       try:
         while True:
           self.processor.process(iprot, oprot)
-      except TTransport.TTransportException, tx:
+      except TTransport.TTransportException as tx:
         pass
-      except Exception, x:
+      except Exception as x:
         logger.exception(x)
 
       itrans.close()
@@ -114,7 +114,7 @@
         t.start()
       except KeyboardInterrupt:
         raise
-      except Exception, x:
+      except Exception as x:
         logger.exception(x)
 
   def handle(self, client):
@@ -125,9 +125,9 @@
     try:
       while True:
         self.processor.process(iprot, oprot)
-    except TTransport.TTransportException, tx:
+    except TTransport.TTransportException as tx:
       pass
-    except Exception, x:
+    except Exception as x:
       logger.exception(x)
 
     itrans.close()
@@ -153,7 +153,7 @@
       try:
         client = self.clients.get()
         self.serveClient(client)
-      except Exception, x:
+      except Exception as x:
         logger.exception(x)
 
   def serveClient(self, client):
@@ -165,9 +165,9 @@
     try:
       while True:
         self.processor.process(iprot, oprot)
-    except TTransport.TTransportException, tx:
+    except TTransport.TTransportException as tx:
       pass
-    except Exception, x:
+    except Exception as x:
       logger.exception(x)
 
     itrans.close()
@@ -180,7 +180,7 @@
         t = threading.Thread(target=self.serveThread)
         t.setDaemon(self.daemon)
         t.start()
-      except Exception, x:
+      except Exception as x:
         logger.exception(x)
 
     # Pump the socket for clients
@@ -191,7 +191,7 @@
         if not client:
           continue
         self.clients.put(client)
-      except Exception, x:
+      except Exception as x:
         logger.exception(x)
 
 
@@ -216,7 +216,7 @@
     def try_close(file):
       try:
         file.close()
-      except IOError, e:
+      except IOError as e:
         logger.warning(e, exc_info=True)
 
     self.serverTransport.listen()
@@ -250,9 +250,9 @@
             try:
               while True:
                 self.processor.process(iprot, oprot)
-            except TTransport.TTransportException, tx:
+            except TTransport.TTransportException as tx:
               pass
-            except Exception, e:
+            except Exception as e:
               logger.exception(e)
               ecode = 1
           finally:
@@ -261,9 +261,9 @@
 
           os._exit(ecode)
 
-      except TTransport.TTransportException, tx:
+      except TTransport.TTransportException as tx:
         pass
-      except Exception, x:
+      except Exception as x:
         logger.exception(x)
 
   def collect_children(self):