diff py/utils.py @ 529:5201f441bf4a

run 2to3
author Matt Johnston <matt@ucc.asn.au>
date Fri, 10 Apr 2015 23:59:16 +0800
parents fe729664a5e6
children 0a1b642e3086
line wrap: on
line diff
--- a/py/utils.py	Fri Apr 10 23:55:07 2015 +0800
+++ b/py/utils.py	Fri Apr 10 23:59:16 2015 +0800
@@ -60,7 +60,7 @@
                 time.sleep(try_time)
             return None
 
-        new_f.func_name = func.func_name
+        new_f.__name__ = func.__name__
         return new_f
     return inner
 
@@ -113,7 +113,7 @@
         pid = os.fork()
         if pid > 0:
             sys.exit(0)
-    except OSError, e:
+    except OSError as e:
         E("Bad fork()")
         sys.exit(1)
 
@@ -123,13 +123,13 @@
         pid = os.fork()
         if pid > 0:
             sys.exit(0)
-    except OSError, e:
+    except OSError as e:
         E("Bad fork()")
         sys.exit(1)
 
 def uptime():
     try:
         return float(open('/proc/uptime', 'r').read().split(' ', 1)[0])
-    except Exception, e:
+    except Exception as e:
         return -1