diff --git a/python/typewrappers.h b/python/typewrappers.h index 305d594401..70c15d9f9d 100644 --- a/python/typewrappers.h +++ b/python/typewrappers.h @@ -1,7 +1,7 @@ /* * libvirt_wrap.h: type wrappers for libvir python bindings * - * Copyright (C) 2005 Red Hat, Inc. + * Copyright (C) 2005, 2011 Red Hat, Inc. * * Daniel Veillard */ @@ -21,6 +21,11 @@ # define ATTRIBUTE_UNUSED #endif +/* Work around really old python. */ +#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 7 +typedef ssize_t Py_ssize_t; +#endif + #define PyvirConnect_Get(v) (((v) == Py_None) ? NULL : \ (((PyvirConnect_Object *)(v))->obj))