summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorNotAFile <nota@notafile.com>2018-03-15 16:11:17 +0100
committerNotAFile <nota@notafile.com>2018-03-15 16:11:17 +0100
commit2cc9f76bc3cfa012dcdfe614bdda7e689b8b5e65 (patch)
treeb9067a68b9a1638a25fa4c1908d6ea6014c7d30f /synapse/app
parentMerge pull request #3003 from matrix-org/rav/fix_contributing (diff)
downloadsynapse-2cc9f76bc3cfa012dcdfe614bdda7e689b8b5e65.tar.xz
replace old style error catching with 'as' keyword
This is both easier to read and compatible with python3 (not that that
matters)

Signed-off-by: Adrian Tschira <nota@notafile.com>
Diffstat (limited to 'synapse/app')
-rwxr-xr-xsynapse/app/synctl.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/app/synctl.py b/synapse/app/synctl.py
index 0f0ddfa78a..b0e1b5e66a 100755
--- a/synapse/app/synctl.py
+++ b/synapse/app/synctl.py
@@ -38,7 +38,7 @@ def pid_running(pid):
     try:
         os.kill(pid, 0)
         return True
-    except OSError, err:
+    except OSError as err:
         if err.errno == errno.EPERM:
             return True
         return False
@@ -98,7 +98,7 @@ def stop(pidfile, app):
         try:
             os.kill(pid, signal.SIGTERM)
             write("stopped %s" % (app,), colour=GREEN)
-        except OSError, err:
+        except OSError as err:
             if err.errno == errno.ESRCH:
                 write("%s not running" % (app,), colour=YELLOW)
             elif err.errno == errno.EPERM: