diff options
author | Adrian Tschira <nota@notafile.com> | 2018-04-07 00:37:36 +0200 |
---|---|---|
committer | Adrian Tschira <nota@notafile.com> | 2018-04-07 01:02:32 +0200 |
commit | e54c202b81707ef02b2e640489a69c2b266bebff (patch) | |
tree | 5418a0b3627ae1c880d19e58e839582b9c7a0331 /synapse/config/_base.py | |
parent | Merge pull request #3046 from matrix-org/dbkr/join_group (diff) | |
download | synapse-e54c202b81707ef02b2e640489a69c2b266bebff.tar.xz |
Replace some type checks with six type checks
Signed-off-by: Adrian Tschira <nota@notafile.com>
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 |