diff options
author | Adrian Tschira <nota@notafile.com> | 2018-04-15 21:43:35 +0200 |
---|---|---|
committer | Adrian Tschira <nota@notafile.com> | 2018-05-19 17:56:31 +0200 |
commit | d9fe2b2d9dbb539da32f969b8bd752159fd5eb6f (patch) | |
tree | ed9440ba4276d0a6aba07c6560fa19b4e0a25be0 /synapse/push/push_rule_evaluator.py | |
parent | Merge pull request #3241 from matrix-org/fix_user_visits_insertion (diff) | |
download | synapse-d9fe2b2d9dbb539da32f969b8bd752159fd5eb6f.tar.xz |
Replace some more comparisons with six
plus a bonus b"" string I missed last time Signed-off-by: Adrian Tschira <nota@notafile.com>
Diffstat (limited to 'synapse/push/push_rule_evaluator.py')
-rw-r--r-- | synapse/push/push_rule_evaluator.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py index 3601f2d365..d55efde8cc 100644 --- a/synapse/push/push_rule_evaluator.py +++ b/synapse/push/push_rule_evaluator.py @@ -21,6 +21,8 @@ from synapse.types import UserID from synapse.util.caches import CACHE_SIZE_FACTOR, register_cache from synapse.util.caches.lrucache import LruCache +from six import string_types + logger = logging.getLogger(__name__) @@ -238,7 +240,7 @@ def _flatten_dict(d, prefix=[], result=None): if result is None: result = {} for key, value in d.items(): - if isinstance(value, basestring): + if isinstance(value, string_types): result[".".join(prefix + [key])] = value.lower() elif hasattr(value, "items"): _flatten_dict(value, prefix=(prefix + [key]), result=result) |