From 6c11bb956cd50ce65be9ff9e32f9206b12b8413c Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 11 Apr 2016 10:58:24 +0100 Subject: Fix pypy repr for DomainSpecificString --- synapse/rest/client/v2_alpha/sync.py | 2 +- synapse/types.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/synapse/rest/client/v2_alpha/sync.py b/synapse/rest/client/v2_alpha/sync.py index 81fc378556..b45b4afa33 100644 --- a/synapse/rest/client/v2_alpha/sync.py +++ b/synapse/rest/client/v2_alpha/sync.py @@ -109,7 +109,7 @@ class SyncRestServlet(RestServlet): full_state = parse_boolean(request, "full_state", default=False) logger.info( - "/sync: user=%r, timeout=%r, since=%r," + "/sync: user=%s, timeout=%r, since=%r," " set_presence=%r, filter_id=%r" % ( user, timeout, since, set_presence, filter_id ) diff --git a/synapse/types.py b/synapse/types.py index 5b166835bd..5c9692b55f 100644 --- a/synapse/types.py +++ b/synapse/types.py @@ -37,7 +37,7 @@ class DomainSpecificString( # set by: # users = set(user) def __iter__(self): - raise ValueError("Attempted to iterate a %s" % (type(self).__name__,)) + raise ValueError("Attempted to iterate a %s" % (type(self).__name__,),) # Because this class is a namedtuple of strings and booleans, it is deeply # immutable. @@ -83,6 +83,11 @@ class DomainSpecificString( __str__ = to_string + def __repr__(self): + return "%r(%r, %r)" % ( + type(self).__name__, self.localpart, self.domain, + ) + @classmethod def create(cls, localpart, domain,): return cls(localpart=localpart, domain=domain) -- cgit 1.4.1