summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.py b/main.py
index 1b5c2d0..e933210 100644
--- a/main.py
+++ b/main.py
@@ -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):