diff options
author | Anthon van der Neut <anthon@mnt.org> | 2019-02-27 22:23:14 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2019-02-27 22:23:14 +0100 |
commit | 17af0e7a084955b5c0bf4124bba87190ac16734d (patch) | |
tree | 99a390343fd3cc141278c5768e9cbfd15778ebba /representer.py | |
parent | 1fa26ba7438db4edcd6f7748dd7cf2ec3a00c241 (diff) | |
download | ruamel.yaml-17af0e7a084955b5c0bf4124bba87190ac16734d.tar.gz |
fix issue #280 namedtuple erorring in error generation on safe_dump
*When this change indeed resolves your problem, please **Close** this issue*.
*(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to 'representer.py')
-rw-r--r-- | representer.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/representer.py b/representer.py index 859887c..946a909 100644 --- a/representer.py +++ b/representer.py @@ -389,7 +389,7 @@ class SafeRepresenter(BaseRepresenter): def represent_undefined(self, data): # type: (Any) -> None - raise RepresenterError('cannot represent an object: %s' % data) + raise RepresenterError('cannot represent an object: %s' % (data,)) SafeRepresenter.add_representer(type(None), SafeRepresenter.represent_none) @@ -573,7 +573,7 @@ class Representer(SafeRepresenter): elif hasattr(data, '__reduce__'): reduce = data.__reduce__() else: - raise RepresenterError('cannot represent object: %r' % data) + raise RepresenterError('cannot represent object: %r' % (data,)) reduce = (list(reduce) + [None] * 5)[:5] function, args, state, listitems, dictitems = reduce args = list(args) |