Mercurial > templog
diff py/params.py @ 230:185621f47040
run 2to3
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 10 Apr 2015 23:59:16 +0800 |
parents | d9e81a563923 |
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()