mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:36:02 -04:00
Replace some more comparisons with six
plus a bonus b"" string I missed last time Signed-off-by: Adrian Tschira <nota@notafile.com>
This commit is contained in:
parent
08462620bf
commit
d9fe2b2d9d
6 changed files with 23 additions and 11 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue