Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions c-ext/backend_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ void zstd_module_init(PyObject *m) {
*/
PyObject *features = NULL;
PyObject *feature = NULL;
unsigned zstd_ver_no = ZSTD_versionNumber();
unsigned our_hardcoded_version = 10507;
if (ZSTD_VERSION_NUMBER != our_hardcoded_version ||
zstd_ver_no != our_hardcoded_version) {
unsigned zstd_version_min = 10506;
Copy link
Author

@georgthegreat georgthegreat Aug 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed in 41f6dfa but it does not seem necessary, there are no actual ABI deps on 1.5.7

// if either compile-time or runtime version of libzstd is lower than expected, abort initialization
if (ZSTD_VERSION_NUMBER < zstd_version_min ||
ZSTD_versionNumber() < ztd_version_min) {
PyErr_Format(
PyExc_ImportError,
"zstd C API versions mismatch; Python bindings were not "
"compiled/linked against expected zstd version (%u returned by the "
"lib, %u hardcoded in zstd headers, %u hardcoded in the cext)",
zstd_ver_no, ZSTD_VERSION_NUMBER, our_hardcoded_version);
ZSTD_versionNumber(), ZSTD_VERSION_NUMBER, zstd_version_min);
return;
}

Expand Down