Skip to content

Commit 3605e11

Browse files
committed
Switch from RuntimeError to ValueError
1 parent db0ace3 commit 3605e11

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/test/test_zstd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def test_set_pledged_input_size(self):
434434
c = ZstdCompressor(level=1)
435435
c.compress(b'123456')
436436
self.assertEqual(c.last_mode, c.CONTINUE)
437-
with self.assertRaisesRegex(RuntimeError,
437+
with self.assertRaisesRegex(ValueError,
438438
r'last_mode == FLUSH_FRAME'):
439439
c.set_pledged_input_size(300)
440440

Modules/_zstd/compressor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ _zstd_ZstdCompressor_set_pledged_input_size_impl(ZstdCompressor *self,
770770

771771
/* Check the current mode */
772772
if (self->last_mode != ZSTD_e_end) {
773-
PyErr_SetString(PyExc_RuntimeError,
773+
PyErr_SetString(PyExc_ValueError,
774774
"set_pledged_input_size() method must be called "
775775
"when last_mode == FLUSH_FRAME");
776776
PyMutex_Unlock(&self->lock);

0 commit comments

Comments
 (0)