diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-09-19 12:03:10 +0100 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-09-19 12:03:10 +0100 |
commit | 30c085fbc33e7ad47c31f28debd23bacaf41b599 (patch) | |
tree | 7c7c01553364b48f99e1091c8b4e31520b97ef86 | |
parent | Add unit tests for strip_invalid_mxid_characters (diff) | |
download | synapse-30c085fbc33e7ad47c31f28debd23bacaf41b599.tar.xz |
Use six.moves.filter when filtering out from MXID
Python 2's filter() function and Python 3's don't return the same type when processing a string (respectively str and filter), therefore use six's compatibility mapping (which resolves to itertools.ifilter() if using Python2), then generate a string from the filtered list, in order to ensure consistent behaviour between Python 2 and Python 3.
-rw-r--r-- | synapse/types.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/types.py b/synapse/types.py |