Skip to content

Commit 2bef383

Browse files
committed
Use a macro for the minimum supported version
1 parent 56b04a8 commit 2bef383

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Modules/_zstd/_zstdmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ _zstd__finalize_dict_impl(PyObject *module, PyBytesObject *custom_dict_bytes,
308308
int compression_level)
309309
/*[clinic end generated code: output=9c2a7d8c845cee93 input=ef6f4f2b0b7e178d]*/
310310
{
311-
if (ZSTD_versionNumber() < 10405) {
311+
if (ZSTD_versionNumber() < PYTHON_MINIMUM_SUPPORTED_ZSTD_VERSION) {
312312
/* Must be dynamically linked */
313313
PyErr_Format(PyExc_NotImplementedError,
314314
"The _finalize_dict function is only available when the underlying "

Modules/_zstd/_zstdmodule.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Refactored for the CPython standard library by Emma Harper Smith.
1616

1717
#include "pycore_lock.h" // PyMutex APIs
1818

19-
#if ZSTD_VERSION_NUMBER < 10405
19+
#define PYTHON_MINIMUM_SUPPORTED_ZSTD_VERSION 10405
20+
21+
#if ZSTD_VERSION_NUMBER < PYTHON_MINIMUM_SUPPORTED_ZSTD_VERSION
2022
#error "_zstd module requires zstd v1.4.5+"
2123
#endif
2224

0 commit comments

Comments
 (0)