diff py/params.py @ 529:5201f441bf4a

run 2to3
author Matt Johnston <matt@ucc.asn.au>
date Fri, 10 Apr 2015 23:59:16 +0800
parents dd8895652485
children e39ed85d87a5
line wrap: on
line diff
--- a/py/params.py	Fri Apr 10 23:55:07 2015 +0800
+++ b/py/params.py	Fri Apr 10 23:59:16 2015 +0800
@@ -2,7 +2,7 @@
 import collections
 import json
 import signal
-import StringIO
+import io
 
 import config
 from utils import W,L,E,EX
@@ -37,12 +37,12 @@
         if not f:
             try:
                 f = file(config.PARAMS_FILE, 'r')
-            except IOError, e:
+            except IOError as e:
                 W("Missing parameter file, using defaults. %s", e)
                 return
         try:
             u = json.load(f)
-        except Exception, e:
+        except Exception as e:
             raise self.Error(e)
 
         for k in u:
@@ -64,6 +64,6 @@
         f.flush()
 
     def save_string(self):
-        s = StringIO.StringIO()
+        s = io.StringIO()
         self.save(s)
         return s.getvalue()