10BC0 gh-132983: Clean-ups for `_zstd` by AA-Turner · Pull Request #133670 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Merged
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
Prev Previous commit
Next Next commit
Use PyModule_Add
  • Loading branch information
AA-Turner committed May 9, 2025
commit dd1380dfa6264eb918af222e48e5c5d83165bcaf
8 changes: 3 additions & 5 deletions Modules/_zstd/_zstdmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,11 @@ add_vars_to_module(PyObject *module)
}

/* zstd_version_info, tuple of (int, int, int) */
PyObject *vi = Py_BuildValue("BBB", ZSTD_VERSION_MAJOR, ZSTD_VERSION_MINOR,
ZSTD_VERSION_RELEASE);
if (PyModule_AddObjectRef(module, "zstd_version_info", vi) < 0) {
Py_XDECREF(vi);
if (PyModule_Add(module, "zstd_version_info",
Py_BuildValue("BBB", ZSTD_VERSION_MAJOR, ZSTD_VERSION_MINOR,
ZSTD_VERSION_RELEASE)) < 0) {
return -1;
}
Py_DECREF(vi);

/* ZSTD_CLEVEL_DEFAULT, int */
#if ZSTD_VERSION_NUMBER >= 10500
Expand Down
0