aboutsummaryrefslogtreecommitdiff
path: root/lib3
diff options
context:
space:
mode:
authorTimofei Bondarev <bondarevts@gmail.com>2017-03-01 00:45:09 -0500
committerIan Stapleton Cordasco <graffatcolmingov@gmail.com>2017-08-08 06:02:01 -0500
commitef744d8609f47e8b70ce007ecfe6595d3c367174 (patch)
tree3121bb1a353cd16eb0e71d3d59bba0d328764e6c /lib3
parent2c55eb674948fb07a8552a2ce684365e3551f5e9 (diff)
downloadpyyaml-ef744d8609f47e8b70ce007ecfe6595d3c367174.tar.gz
Improve RepresenterError creation
Diffstat (limited to 'lib3')
-rw-r--r--lib3/yaml/representer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib3/yaml/representer.py b/lib3/yaml/representer.py
index b9e65c5..483005f 100644
--- a/lib3/yaml/representer.py
+++ b/lib3/yaml/representer.py
@@ -226,7 +226,7 @@ class SafeRepresenter(BaseRepresenter):
return self.represent_mapping(tag, state, flow_style=flow_style)
def represent_undefined(self, data):
- raise RepresenterError("cannot represent an object: %s" % data)
+ raise RepresenterError("cannot represent an object", data)
SafeRepresenter.add_representer(type(None),
SafeRepresenter.represent_none)
@@ -316,7 +316,7 @@ class Representer(SafeRepresenter):
elif hasattr(data, '__reduce__'):
reduce = data.__reduce__()
else:
- raise RepresenterError("cannot represent object: %r" % data)
+ raise RepresenterError("cannot represent an object", data)
reduce = (list(reduce)+[None]*5)[:5]
function, args, state, listitems, dictitems = reduce
args = list(args)