THRIFT-4370: build generated code before running static code analysis;
fix E722 flake8 issues identified in python code

This closes #1399
diff --git a/test/features/string_limit.py b/test/features/string_limit.py
index 14f57d0..b8991d6 100644
--- a/test/features/string_limit.py
+++ b/test/features/string_limit.py
@@ -51,7 +51,7 @@
     print('[OK]: just limit')
     try:
         test_string(proto, 'a' * (args.limit + 1))
-    except:
+    except Exception:
         print('[OK]: limit + 1')
     else:
         print('[ERROR]: limit + 1')