diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-04-09 23:40:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-09 23:40:44 +0100 |
commit | 8eaa141d8f1ffb4a437bc9e9220febde51e3497e (patch) | |
tree | 736679fd840ff67f9844dc99b9be7db0c6b71623 /synapse/config/_base.py | |
parent | Merge pull request #3016 from silkeh/improve-service-lookups (diff) | |
parent | Replace some type checks with six type checks (diff) | |
download | synapse-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.py | 6 |
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 |