Commit 9cdf93fc authored by Guido van Rossum's avatar Guido van Rossum

Use short_repr() instead of repr() a few more places.

parent c297ff32
...@@ -182,7 +182,7 @@ class Connection(smac.SizedMessageAsyncConnection): ...@@ -182,7 +182,7 @@ class Connection(smac.SizedMessageAsyncConnection):
if message == self.protocol_version: if message == self.protocol_version:
self.message_input = self._message_input self.message_input = self._message_input
else: else:
log("recv_handshake: bad handshake %s" % repr(message), log("recv_handshake: bad handshake %s" % short_repr(message),
level=zLOG.ERROR) level=zLOG.ERROR)
# otherwise do something else... # otherwise do something else...
...@@ -236,7 +236,7 @@ class Connection(smac.SizedMessageAsyncConnection): ...@@ -236,7 +236,7 @@ class Connection(smac.SizedMessageAsyncConnection):
if flags & ASYNC: if flags & ASYNC:
if ret is not None: if ret is not None:
raise ZRPCError("async method %s returned value %s" % raise ZRPCError("async method %s returned value %s" %
(name, repr(ret))) (name, short_repr(ret)))
else: else:
if __debug__: if __debug__:
log("%s returns %s" % (name, short_repr(ret)), zLOG.DEBUG) log("%s returns %s" % (name, short_repr(ret)), zLOG.DEBUG)
...@@ -265,7 +265,7 @@ class Connection(smac.SizedMessageAsyncConnection): ...@@ -265,7 +265,7 @@ class Connection(smac.SizedMessageAsyncConnection):
msg = self.marshal.encode(msgid, 0, REPLY, ret) msg = self.marshal.encode(msgid, 0, REPLY, ret)
except self.marshal.errors: except self.marshal.errors:
try: try:
r = repr(ret) r = short_repr(ret)
except: except:
r = "<unreprable>" r = "<unreprable>"
err = ZRPCError("Couldn't pickle return %.100s" % r) err = ZRPCError("Couldn't pickle return %.100s" % r)
...@@ -284,7 +284,7 @@ class Connection(smac.SizedMessageAsyncConnection): ...@@ -284,7 +284,7 @@ class Connection(smac.SizedMessageAsyncConnection):
msg = self.marshal.encode(msgid, 0, REPLY, (err_type, err_value)) msg = self.marshal.encode(msgid, 0, REPLY, (err_type, err_value))
except self.marshal.errors: except self.marshal.errors:
try: try:
r = repr(err_value) r = short_repr(err_value)
except: except:
r = "<unreprable>" r = "<unreprable>"
err = ZRPCError("Couldn't pickle error %.100s" % r) err = ZRPCError("Couldn't pickle error %.100s" % r)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment