Skip to content

Commit 60ca52d

Browse files
authored
Fix logic for quoting special characters (#276)
* Fix logic for quoting special characters * Remove has_ucs4 from condition on systems with `sys.maxunicode <= 0xffff` the comparison (u'\U00010000' <= ch < u'\U0010ffff') can't be true anyway I think
1 parent 66454d9 commit 60ca52d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/yaml/emitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ def analyze_scalar(self, scalar):
706706
if not (ch == u'\n' or u'\x20' <= ch <= u'\x7E'):
707707
if (ch == u'\x85' or u'\xA0' <= ch <= u'\uD7FF'
708708
or u'\uE000' <= ch <= u'\uFFFD'
709-
or ((not has_ucs4) or (u'\U00010000' <= ch < u'\U0010ffff'))) and ch != u'\uFEFF':
709+
or (u'\U00010000' <= ch < u'\U0010ffff')) and ch != u'\uFEFF':
710710
unicode_characters = True
711711
if not self.allow_unicode:
712712
special_characters = True

0 commit comments

Comments
 (0)