diff --git a/lib/yaml/representer.py b/lib/yaml/representer.py index 4ea8cb1f..f249f083 100644 --- a/lib/yaml/representer.py +++ b/lib/yaml/representer.py @@ -246,7 +246,7 @@ def represent_yaml_object(self, tag, data, cls, flow_style=None): 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 @@ def represent_object(self, data): 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 b9e65c51..483005f4 100644 --- a/lib3/yaml/representer.py +++ b/lib3/yaml/representer.py @@ -226,7 +226,7 @@ def represent_yaml_object(self, tag, data, cls, flow_style=None): 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 @@ def represent_object(self, data): 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)