Improve RepresenterError creation
diff --git a/lib/yaml/representer.py b/lib/yaml/representer.py index 4ea8cb1..f249f08 100644 --- a/lib/yaml/representer.py +++ b/lib/yaml/representer.py
@@ -246,7 +246,7 @@ 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) @@ -411,7 +411,7 @@ 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)
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 @@ 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 @@ 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)