diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:11:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:11:27 +0000 |
commit | f3bcaf9f88aad2c423ebcd61121562f9834187d4 (patch) | |
tree | f22238c29b57707b645a350940e3e9bdf3ce1f5d /third_party/python/PyYAML/lib/yaml/error.py | |
parent | Adding debian version 115.7.0esr-1~deb12u1. (diff) | |
download | firefox-esr-f3bcaf9f88aad2c423ebcd61121562f9834187d4.tar.xz firefox-esr-f3bcaf9f88aad2c423ebcd61121562f9834187d4.zip |
Merging upstream version 115.8.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/PyYAML/lib/yaml/error.py')
-rw-r--r-- | third_party/python/PyYAML/lib/yaml/error.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/third_party/python/PyYAML/lib/yaml/error.py b/third_party/python/PyYAML/lib/yaml/error.py index 577686db5f..b796b4dc51 100644 --- a/third_party/python/PyYAML/lib/yaml/error.py +++ b/third_party/python/PyYAML/lib/yaml/error.py @@ -1,7 +1,7 @@ __all__ = ['Mark', 'YAMLError', 'MarkedYAMLError'] -class Mark(object): +class Mark: def __init__(self, name, index, line, column, buffer, pointer): self.name = name @@ -16,7 +16,7 @@ class Mark(object): return None head = '' start = self.pointer - while start > 0 and self.buffer[start-1] not in u'\0\r\n\x85\u2028\u2029': + while start > 0 and self.buffer[start-1] not in '\0\r\n\x85\u2028\u2029': start -= 1 if self.pointer-start > max_length/2-1: head = ' ... ' @@ -24,13 +24,13 @@ class Mark(object): break tail = '' end = self.pointer - while end < len(self.buffer) and self.buffer[end] not in u'\0\r\n\x85\u2028\u2029': + while end < len(self.buffer) and self.buffer[end] not in '\0\r\n\x85\u2028\u2029': end += 1 if end-self.pointer > max_length/2-1: tail = ' ... ' end -= 5 break - snippet = self.buffer[start:end].encode('utf-8') + snippet = self.buffer[start:end] return ' '*indent + head + snippet + tail + '\n' \ + ' '*(indent+self.pointer-start+len(head)) + '^' |