From 5afff21c212eb07b45b9c6919eedaf3339fa569b Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 3 Oct 2012 22:56:18 +0200 Subject: [PATCH] Use "%r" % v instead of "%s" % repr(v) -- it is shorter and more idiomatic. --- irkerd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/irkerd b/irkerd index 80dae80..f49535c 100755 --- a/irkerd +++ b/irkerd @@ -382,21 +382,21 @@ class Irker: try: request = json.loads(line.strip()) if type(request) != type({}): - self.logerr("request in tot a JSON dictionary: %s" % repr(request)) + self.logerr("request in tot a JSON dictionary: %r" % request) elif "to" not in request or "privmsg" not in request: - self.logerr("malformed reqest - 'to' or 'privmsg' missing: %s" % repr(request)) + self.logerr("malformed reqest - 'to' or 'privmsg' missing: %r" % request) else: channels = request['to'] message = request['privmsg'] if type(channels) not in (type([]), type(u"")) \ or type(message) != type(u""): - self.logerr("malformed request - unexpected types: %s" % repr(request)) + self.logerr("malformed request - unexpected types: %r" % request) else: if type(channels) == type(u""): channels = [channels] for url in channels: if type(url) != type(u""): - self.logerr("malformed request - unexpected type: %s" % repr(request)) + self.logerr("malformed request - unexpected type: %r" % request) else: target = Target(url) if not target.valid(): @@ -432,7 +432,7 @@ class Irker: oldtime = server.last_xmit() del self.servers[oldest] except ValueError: - self.logerr("can't recognize JSON on input: %s" % repr(line)) + self.logerr("can't recognize JSON on input: %r" % line) except RuntimeError: self.logerr("wildly malformed JSON blew the parser stack.") -- 2.26.2