summary refs log tree commit diff
path: root/synapse/config/_base.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-04-09 23:40:44 +0100
committerGitHub <noreply@github.com>2018-04-09 23:40:44 +0100
commit8eaa141d8f1ffb4a437bc9e9220febde51e3497e (patch)
tree736679fd840ff67f9844dc99b9be7db0c6b71623 /synapse/config/_base.py
parentMerge pull request #3016 from silkeh/improve-service-lookups (diff)
parentReplace some type checks with six type checks (diff)
downloadsynapse-8eaa141d8f1ffb4a437bc9e9220febde51e3497e.tar.xz
Merge pull request #3075 from NotAFile/six-type-checks
Replace some type checks with six type checks
Diffstat (limited to 'synapse/config/_base.py')
-rw-r--r--synapse/config/_base.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/config/_base.py b/synapse/config/_base.py
index fa105bce72..f79bd3dfc7 100644
--- a/synapse/config/_base.py
+++ b/synapse/config/_base.py
@@ -19,6 +19,8 @@ import os
 import yaml
 from textwrap import dedent
 
+from six import integer_types
+
 
 class ConfigError(Exception):
     pass
@@ -49,7 +51,7 @@ Missing mandatory `server_name` config option.
 class Config(object):
     @staticmethod
     def parse_size(value):
-        if isinstance(value, int) or isinstance(value, long):
+        if isinstance(value, integer_types):
             return value
         sizes = {"K": 1024, "M": 1024 * 1024}
         size = 1
@@ -61,7 +63,7 @@ class Config(object):
 
     @staticmethod
     def parse_duration(value):
-        if isinstance(value, int) or isinstance(value, long):
+        if isinstance(value, integer_types):
             return value
         second = 1000
         minute = 60 * second