summaryrefslogtreecommitdiffstats
path: root/third_party/python/PyYAML/lib/yaml/error.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:12:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:12:12 +0000
commita7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431 (patch)
tree54617b4f5f04ee87a2c9e3b97cc88b8626859124 /third_party/python/PyYAML/lib/yaml/error.py
parentReleasing progress-linux version 115.7.0esr-1~deb12u1progress7u1. (diff)
downloadfirefox-esr-a7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431.tar.xz
firefox-esr-a7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431.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.py8
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)) + '^'