THRIFT-4405: fix cygwin on appveyor
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index 33ba203..c4146cc 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -69,12 +69,12 @@
 // agreement between client and server.
 //
 
-template<class _P>
-class TPedanticProtocol : public _P
+template<typename Proto>
+class TPedanticProtocol : public Proto 
 {
     public:
         TPedanticProtocol(std::shared_ptr<TTransport>& transport)
-          : _P(transport), m_last_seqid((std::numeric_limits<int32_t>::max)() - 10) { }
+          : Proto(transport), m_last_seqid((std::numeric_limits<int32_t>::max)() - 10) { }
 
         virtual uint32_t writeMessageBegin_virt(const std::string& name,
                                            const TMessageType messageType,
@@ -85,14 +85,14 @@
                 seqid = ++m_last_seqid;
             }
 
-            return _P::writeMessageBegin_virt(name, messageType, seqid);
+            return Proto::writeMessageBegin_virt(name, messageType, seqid);
         }
 
         virtual uint32_t readMessageBegin_virt(std::string& name,
                                           TMessageType& messageType,
                                           int32_t& seqid) override
         {
-            uint32_t result = _P::readMessageBegin_virt(name, messageType, seqid);
+            uint32_t result = Proto::readMessageBegin_virt(name, messageType, seqid);
             if (seqid != m_last_seqid) {
                 std::stringstream ss;
                 ss << "ERROR: send request with seqid " << m_last_seqid << " and got reply with seqid " << seqid;
diff --git a/test/crossrunner/run.py b/test/crossrunner/run.py
index ef8fb60..bb06d25 100644
--- a/test/crossrunner/run.py
+++ b/test/crossrunner/run.py
@@ -259,7 +259,7 @@
             raise
         logger.warn('Error executing [%s]', test.name, exc_info=True)
         return (retry_count, RESULT_ERROR)
-    except:
+    except Exception:
         logger.info('Interrupted execution', exc_info=True)
         if not async_mode:
             raise
diff --git a/test/py/TestClient.py b/test/py/TestClient.py
index cc9185c..a85098e 100755
--- a/test/py/TestClient.py
+++ b/test/py/TestClient.py
@@ -26,9 +26,7 @@
 
 from optparse import OptionParser
 from util import local_libpath
-
 sys.path.insert(0, local_libpath())
-
 from thrift.protocol import TProtocolDecorator
 from thrift.protocol import TProtocol
 
@@ -277,6 +275,7 @@
 # running on it (when multiplexec)
 LAST_SEQID = None
 
+
 class TPedanticSequenceIdProtocolWrapper(TProtocolDecorator.TProtocolDecorator):
     """
     Wraps any protocol with sequence ID checking: looks for outbound
@@ -289,7 +288,8 @@
     def writeMessageBegin(self, name, type, seqid):
         global LAST_SEQID
         if LAST_SEQID and LAST_SEQID == seqid:
-            raise TProtocol.TProtocolException(INVALID_DATA,
+            raise TProtocol.TProtocolException(
+                TProtocol.TProtocolException.INVALID_DATA,
                 "Python client reused sequence ID {0}".format(seqid))
         LAST_SEQID = seqid
         super(TPedanticSequenceIdProtocolWrapper, self).writeMessageBegin(
@@ -300,7 +300,8 @@
         (name, type, seqid) =\
             super(TPedanticSequenceIdProtocolWrapper, self).readMessageBegin()
         if LAST_SEQID != seqid:
-            raise TProtocol.TProtocolException(INVALID_DATA,
+            raise TProtocol.TProtocolException(
+                TProtocol.TProtocolException.INVALID_DATA,
                 "We sent seqid {0} and server returned seqid {1}".format(
                     self.last, seqid))
         return (name, type, seqid)
@@ -310,6 +311,7 @@
     """ Wrap a protocol in the pedantic sequence ID wrapper. """
     return TPedanticSequenceIdProtocolWrapper(proto)
 
+
 class MultiplexedOptionalTest(AbstractTest):
     def get_protocol2(self, transport):
         return None