summaryrefslogtreecommitdiffstats
path: root/Modules/_zstd/decompressor.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-05-23 22:18:08 (GMT)
committerGitHub <noreply@github.com>2025-05-23 22:18:08 (GMT)
commitf301af627ea5138726a85b5d34ea92bf6198bcad (patch)
treee94129cb4b2656c6715ae42a53f6851310ed3384 /Modules/_zstd/decompressor.c
parent7476f90af2cf9207c792c0dc3ee9a5ca7b4fabfa (diff)
downloadcpython-f301af627ea5138726a85b5d34ea92bf6198bcad.zip
cpython-f301af627ea5138726a85b5d34ea92bf6198bcad.tar.gz
cpython-f301af627ea5138726a85b5d34ea92bf6198bcad.tar.bz2
[3.14] gh-132983: Slightly tweak error messages for _zstd compressor/decompressor options dict (GH-134601) (#134602)
gh-132983: Slightly tweak error messages for _zstd compressor/decompressor options dict (GH-134601) Slightly tweak error messages for options dict (cherry picked from commit f478331f98930d94f7efc741f3bed4b693d5cec1) Co-authored-by: Emma Smith <emma@emmatyping.dev>
Diffstat (limited to 'Modules/_zstd/decompressor.c')
-rw-r--r--Modules/_zstd/decompressor.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/_zstd/decompressor.c b/Modules/_zstd/decompressor.c
index e299f73..70848d9 100644
--- a/Modules/_zstd/decompressor.c
+++ b/Modules/_zstd/decompressor.c
@@ -112,7 +112,7 @@ _zstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
if (Py_TYPE(key) == mod_state->CParameter_type) {
PyErr_SetString(PyExc_TypeError,
"Key of decompression options dict should "
- "NOT be CompressionParameter.");
+ "NOT be a CompressionParameter attribute.");
return -1;
}
@@ -120,12 +120,11 @@ _zstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
int key_v = PyLong_AsInt(key);
if (key_v == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_ValueError,
- "Key of options dict should be a DecompressionParameter attribute.");
+ "Key of options dict should be either a "
+ "DecompressionParameter attribute or an int.");
return -1;
}
- // TODO(emmatyping): check bounds when there is a value error here for better
- // error message?
int value_v = PyLong_AsInt(value);
if (value_v == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_ValueError,