diff options
author | Anthon van der Neut <anthon@mnt.org> | 2023-05-09 22:00:30 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2023-05-09 22:00:30 +0200 |
commit | 67d9d159adfaf182dc65d7553c0837483d69efa0 (patch) | |
tree | c1c9a8044914e9eb98f33a01f4f8a3944fb5bf42 /emitter.py | |
parent | 4a04b2293b3bd3068a70bdfa61c2bdb175e614e0 (diff) | |
download | ruamel.yaml-67d9d159adfaf182dc65d7553c0837483d69efa0.tar.gz |
edge case for 4590.17.26
Diffstat (limited to 'emitter.py')
-rw-r--r-- | emitter.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1402,8 +1402,8 @@ class Emitter: # data = text[start:end] + u'\\' # <<< replaced with following six lines need_backquote = True if len(text) > end: - space_pos = text.index(' ', end) try: + space_pos = text.index(' ', end) if ( '"' not in text[end:space_pos] and "'" not in text[end:space_pos] @@ -1411,7 +1411,7 @@ class Emitter: and text[end - 1 : end + 1] != ' ' ): need_backquote = False - except IndexError: + except (ValueError, IndexError): pass data = text[start:end] + ('\\' if need_backquote else '') if start < end: |