gh-139646: fix typo in pickletools error message (#139647)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
yihong
2025-10-06 18:52:45 +08:00
committed by GitHub
parent 6f3dae0dc5
commit 36a6c2cdfa
2 changed files with 5 additions and 5 deletions

View File

@@ -348,7 +348,7 @@ def read_stringnl(f, decode=True, stripquotes=True, *, encoding='latin-1'):
for q in (b'"', b"'"): for q in (b'"', b"'"):
if data.startswith(q): if data.startswith(q):
if not data.endswith(q): if not data.endswith(q):
raise ValueError("strinq quote %r not found at both " raise ValueError("string quote %r not found at both "
"ends of %r" % (q, data)) "ends of %r" % (q, data))
data = data[1:-1] data = data[1:-1]
break break

View File

@@ -384,13 +384,13 @@ highest protocol among opcodes = 0
self.check_dis_error(b'Sabc"\n.', '', self.check_dis_error(b'Sabc"\n.', '',
"no string quotes around b'abc\"'") "no string quotes around b'abc\"'")
self.check_dis_error(b"S'abc\n.", '', self.check_dis_error(b"S'abc\n.", '',
'''strinq quote b"'" not found at both ends of b"'abc"''') '''string quote b"'" not found at both ends of b"'abc"''')
self.check_dis_error(b'S"abc\n.', '', self.check_dis_error(b'S"abc\n.', '',
r"""strinq quote b'"' not found at both ends of b'"abc'""") r"""string quote b'"' not found at both ends of b'"abc'""")
self.check_dis_error(b"S'abc\"\n.", '', self.check_dis_error(b"S'abc\"\n.", '',
r"""strinq quote b"'" not found at both ends of b'\\'abc"'""") r"""string quote b"'" not found at both ends of b'\\'abc"'""")
self.check_dis_error(b"S\"abc'\n.", '', self.check_dis_error(b"S\"abc'\n.", '',
r"""strinq quote b'"' not found at both ends of b'"abc\\''""") r"""string quote b'"' not found at both ends of b'"abc\\''""")
def test_binstring(self): def test_binstring(self):
self.check_dis(b"T\x03\x00\x00\x00abc.", '''\ self.check_dis(b"T\x03\x00\x00\x00abc.", '''\