community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1698090 - /comdev/reporter.apache.org/trunk/prettify.py
Date Thu, 27 Aug 2015 08:49:59 GMT
Author: sebb
Date: Thu Aug 27 08:49:58 2015
New Revision: 1698090

URL: http://svn.apache.org/r1698090
Log:
Improve handling of errors reading input file

Modified:
    comdev/reporter.apache.org/trunk/prettify.py

Modified: comdev/reporter.apache.org/trunk/prettify.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/prettify.py?rev=1698090&r1=1698089&r2=1698090&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/prettify.py (original)
+++ comdev/reporter.apache.org/trunk/prettify.py Thu Aug 27 08:49:58 2015
@@ -8,12 +8,12 @@ for arg in sys.argv[1:]:
         with open(arg, "r") as f:
             input = json.loads(f.read())
             f.close()
-    except:
+    except Exception as ex:
+        print(ex)
         pass
-
-    out = arg + ".out"
-    print("Writing " + out)
-    with open(out, "w") as f:
-        f.write(json.dumps(input, indent=1, sort_keys=True))
-        f.close()
-
+    else:
+        out = arg + ".out"
+        print("Writing " + out)
+        with open(out, "w") as f:
+            f.write(json.dumps(input, indent=1, sort_keys=True))
+            f.close()



Mime
View raw message