def collect_gdbm(info_add):
try:
- import _gdbm
+ from _gdbm import _GDBM_VERSION
except ImportError:
return
- info_add('gdbm.GDBM_VERSION', '.'.join(map(str, _gdbm._GDBM_VERSION)))
+ info_add('gdbm.GDBM_VERSION', '.'.join(map(str, _GDBM_VERSION)))
def collect_info(info):
def setUpClass():
if support.verbose:
try:
- import _gdbm
- version = _gdbm._GDBM_VERSION
- except (ImportError, AttributeError):
+ from _gdbm import _GDBM_VERSION as version
+ except ImportError:
pass
else:
print(f"gdbm version: {version}")
goto error;
}
+#if defined(GDBM_VERSION_MAJOR) && defined(GDBM_VERSION_MINOR) && \
+ defined(GDBM_VERSION_PATCH)
PyObject *obj = Py_BuildValue("iii", GDBM_VERSION_MAJOR,
GDBM_VERSION_MINOR, GDBM_VERSION_PATCH);
if (obj == NULL) {
Py_DECREF(obj);
goto error;
}
+#endif
return m;