diff options
Diffstat (limited to '')
-rw-r--r-- | synapse/util/stringutils.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/synapse/util/stringutils.py b/synapse/util/stringutils.py index 40cd51a8ca..f029432191 100644 --- a/synapse/util/stringutils.py +++ b/synapse/util/stringutils.py @@ -55,9 +55,7 @@ def random_string_with_symbols(length: int) -> str: def is_ascii(s: bytes) -> bool: try: s.decode("ascii").encode("ascii") - except UnicodeDecodeError: - return False - except UnicodeEncodeError: + except UnicodeError: return False return True |