mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-18 08:43:53 +01:00
In DomainSpecificString, override __repr__ in addition to __str__
For some reason, string interpolation on a DomainSpecificString object like "%r" % (domainSpecificStringObj) fails under PyPy, because the default __repr__ implementation wants to iterate over the object. I'm not sure why that happens, but overriding __repr__ instead of __str__ fixes this problem, and is arguably the more appropriate thing to do anyways.
This commit is contained in:
parent
d1e56cfcd1
commit
f4284d943a
1 changed files with 1 additions and 1 deletions
|
@ -169,7 +169,7 @@ class DomainSpecificString(
|
|||
except Exception:
|
||||
return False
|
||||
|
||||
__str__ = to_string
|
||||
__repr__ = to_string
|
||||
|
||||
|
||||
class UserID(DomainSpecificString):
|
||||
|
|
Loading…
Reference in a new issue