summary refs log tree commit diff
path: root/synapse/events/utils.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-05-24 16:08:57 +0100
committerGitHub <noreply@github.com>2018-05-24 16:08:57 +0100
commit46345187cc7fed4137ce8f669d33a6e590dca471 (patch)
tree0dc10f431ba45079c8adc71dbc898cc374146d52 /synapse/events/utils.py
parentMerge branch 'master' into develop (diff)
parentReplace some more comparisons with six (diff)
downloadsynapse-46345187cc7fed4137ce8f669d33a6e590dca471.tar.xz
Merge pull request #3243 from NotAFile/py3-six-3
Replace some more comparisons with six
Diffstat (limited to 'synapse/events/utils.py')
-rw-r--r--synapse/events/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/events/utils.py b/synapse/events/utils.py
index 824f4a42e3..29ae086786 100644
--- a/synapse/events/utils.py
+++ b/synapse/events/utils.py
@@ -20,6 +20,8 @@ from frozendict import frozendict
 
 import re
 
+from six import string_types
+
 # Split strings on "." but not "\." This uses a negative lookbehind assertion for '\'
 # (?<!stuff) matches if the current position in the string is not preceded
 # by a match for 'stuff'.
@@ -277,7 +279,7 @@ def serialize_event(e, time_now_ms, as_client_event=True,
 
     if only_event_fields:
         if (not isinstance(only_event_fields, list) or
-                not all(isinstance(f, basestring) for f in only_event_fields)):
+                not all(isinstance(f, string_types) for f in only_event_fields)):
             raise TypeError("only_event_fields must be a list of strings")
         d = only_fields(d, only_event_fields)