Skip to content

Commit ff28bf2

Browse files
committed
Use runtime version
1 parent ef2634d commit ff28bf2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Modules/_zstd/_zstdmodule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,12 @@ add_vars_to_module(PyObject *m)
570570
}
571571

572572
/* zstd_version_info, tuple of (int, int, int) */
573+
const unsigned version = ZSTD_versionNumber();
574+
const uint8_t v_major = version / 100 / 100;
575+
const uint8_t v_minor = (version / 100) % 100;
576+
const uint8_t v_release = version % 100;
573577
if (PyModule_Add(m, "zstd_version_info",
574-
Py_BuildValue("BBB", ZSTD_VERSION_MAJOR, ZSTD_VERSION_MINOR,
575-
ZSTD_VERSION_RELEASE)) < 0) {
578+
Py_BuildValue("BBB", v_major, v_minor, v_release)) < 0) {
576579
return -1;
577580
}
578581

0 commit comments

Comments
 (0)