Skip to content

Commit dd1380d

Browse files
committed
Use PyModule_Add
1 parent 663e666 commit dd1380d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Modules/_zstd/_zstdmodule.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -568,13 +568,11 @@ add_vars_to_module(PyObject *module)
568568
}
569569

570570
/* zstd_version_info, tuple of (int, int, int) */
571-
PyObject *vi = Py_BuildValue("BBB", ZSTD_VERSION_MAJOR, ZSTD_VERSION_MINOR,
572-
ZSTD_VERSION_RELEASE);
573-
if (PyModule_AddObjectRef(module, "zstd_version_info", vi) < 0) {
574-
Py_XDECREF(vi);
571+
if (PyModule_Add(module, "zstd_version_info",
572+
Py_BuildValue("BBB", ZSTD_VERSION_MAJOR, ZSTD_VERSION_MINOR,
573+
ZSTD_VERSION_RELEASE)) < 0) {
575574
return -1;
576575
}
577-
Py_DECREF(vi);
578576

579577
/* ZSTD_CLEVEL_DEFAULT, int */
580578
#if ZSTD_VERSION_NUMBER >= 10500

0 commit comments

Comments
 (0)