applied the except and raise fixers to the master branch to close the gap with py3
[nepi.git] / src / nepi / resources / all / collector.py
index ebcd335..4729e01 100644 (file)
@@ -77,7 +77,7 @@ class Collector(ResourceManager):
             
             msg = "No traceName was specified"
             self.error(msg)
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
 
         self._store_path = self.ec.run_dir
 
@@ -117,9 +117,8 @@ class Collector(ResourceManager):
 
             try:
                 result = self.ec.trace(rm.guid, trace_name)
-                f = open(fpath, "w")
-                f.write(result)
-                f.close()
+                with open(fpath, "w") as f:
+                    f.write(result)
             except:
                 import traceback
                 err = traceback.format_exc()