Check for minor version requirement
This commit is contained in:
parent
3702d07434
commit
61932d50b9
@ -55,6 +55,7 @@ New in version 1.0
|
|||||||
|
|
||||||
- Lots of documentation fixes and other nice things like that.
|
- Lots of documentation fixes and other nice things like that.
|
||||||
- Nailed what appears to be the last outstanding memory leak.
|
- Nailed what appears to be the last outstanding memory leak.
|
||||||
|
- Explicitly require libmemcached 0.32 or newer.
|
||||||
|
|
||||||
New in version 0.9
|
New in version 0.9
|
||||||
------------------
|
------------------
|
||||||
|
@ -1210,8 +1210,19 @@ PyMODINIT_FUNC init_pylibmc(void) {
|
|||||||
PyObject *module, *exc_objs;
|
PyObject *module, *exc_objs;
|
||||||
PylibMC_Behavior *b;
|
PylibMC_Behavior *b;
|
||||||
PylibMC_McErr *err;
|
PylibMC_McErr *err;
|
||||||
|
int libmemcached_version_minor;
|
||||||
char name[128];
|
char name[128];
|
||||||
|
|
||||||
|
/* Check minimum requirement of libmemcached version */
|
||||||
|
libmemcached_version_minor = \
|
||||||
|
atoi(strchr(LIBMEMCACHED_VERSION_STRING, '.') + 1);
|
||||||
|
if (libmemcached_version_minor < 32) {
|
||||||
|
PyErr_Format(PyExc_RuntimeError,
|
||||||
|
"pylibmc requires >= libmemcached 0.32, was compiled with %s",
|
||||||
|
LIBMEMCACHED_VERSION_STRING);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (PyType_Ready(&PylibMC_ClientType) < 0) {
|
if (PyType_Ready(&PylibMC_ClientType) < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user