aboutsummaryrefslogtreecommitdiffstats
path: root/yamlish.py
diff options
context:
space:
mode:
Diffstat (limited to 'yamlish.py')
-rw-r--r--yamlish.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/yamlish.py b/yamlish.py
index 467689a..28e8aea 100644
--- a/yamlish.py
+++ b/yamlish.py
@@ -155,10 +155,10 @@ class _YamlishDumper(yaml.dumper.SafeDumper):
def str_representer_compact_multiline(dumper, data):
style = None
- if '\n' in data:
- style = '|'
if isinstance(data, str):
data = data.decode('utf-8') # assumes all your strings are UTF-8 encoded
+ if '\n' in data:
+ style = '|'
tag = u'tag:yaml.org,2002:str'
return dumper.represent_scalar(tag, data, style)