File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -155,16 +155,16 @@ void zstd_module_init(PyObject *m) {
155155 */
156156 PyObject * features = NULL ;
157157 PyObject * feature = NULL ;
158- unsigned zstd_ver_no = ZSTD_versionNumber () ;
159- unsigned our_hardcoded_version = 10507 ;
160- if (ZSTD_VERSION_NUMBER != our_hardcoded_version ||
161- zstd_ver_no != our_hardcoded_version ) {
158+ unsigned zstd_version_min = 10506 ;
159+ // if either compile-time or runtime version of libzstd is lower than expected, abort initialization
160+ if (ZSTD_VERSION_NUMBER < zstd_version_min ||
161+ ZSTD_versionNumber () < zstd_version_min ) {
162162 PyErr_Format (
163163 PyExc_ImportError ,
164164 "zstd C API versions mismatch; Python bindings were not "
165165 "compiled/linked against expected zstd version (%u returned by the "
166166 "lib, %u hardcoded in zstd headers, %u hardcoded in the cext)" ,
167- zstd_ver_no , ZSTD_VERSION_NUMBER , our_hardcoded_version );
167+ ZSTD_versionNumber () , ZSTD_VERSION_NUMBER , zstd_version_min );
168168 return ;
169169 }
170170
You can’t perform that action at this time.
0 commit comments