diff options
author | Anthon van der Neut <anthon@mnt.org> | 2017-12-03 11:06:38 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2017-12-03 11:06:38 +0100 |
commit | 029e34d4f9054a53fb2cf914cec2fff7b217d761 (patch) | |
tree | ed220ff7b640ff5f83ab113e1c1c27af46c90764 /main.py | |
parent | a1ec92faa38de632fbfeb3d23275223d759c8c22 (diff) | |
download | ruamel.yaml-029e34d4f9054a53fb2cf914cec2fff7b217d761.tar.gz |
allow None stream if transforming0.15.35
If YAML.dump() is passed a transform function, specifying None
will ignore the return value of that function.
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -399,7 +399,10 @@ class YAML(object): val = stream.getvalue() # type: ignore if self.encoding: val = val.decode(self.encoding) - fstream.write(transform(val)) + if fstream is None: + transform(val) + else: + fstream.write(transform(val)) return None def get_serializer_representer_emitter(self, stream, tlca): |