add words from "The Top 500 Worst Passwords of All Time" <http://www.whatsmypass.com/the-top-500-worst-passwords-of-all-time> to dicts/cracklib-small (patch by Fabian Greffrath)
include sys/stat.h in python/_cracklibmodule.c (Mike Frysinger)
add test suite for Python binding (Jan Dittberner)
+ port Python binding to Python3 (Jan Dittberner)
v2.8.18 also include stdlib.h in stringlib.c (Mike Frysinger)
make sure python lib builds against build dir instead of system installed libs (Arfrever Frehtes Taifersar Arahesis)
v2.8.17 fixed compilation on interix systems
* Parts of this code are based on work Copyright (c) 2003 by Domenico
* Andreoli.
*
- * Copyright (c) 2008, 2009 Jan Dittberner <jan@dittberner.info>
+ * Copyright (c) 2008, 2009, 2012 Jan Dittberner <jan@dittberner.info>
*
* This file is part of cracklib.
*
#else
#include <Python.h>
#endif
+#if PY_MAJOR_VERSION >= 3
+#define IS_PY3K
+#endif
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#endif
"program or interpreter.\n"
;
+#ifdef IS_PY3K
+
+static struct PyModuleDef moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "_cracklib",
+ _cracklib_doc,
+ 0,
+ _cracklibmethods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+#define INITERROR return NULL
+
+PyObject *
+PyInit__cracklib(void)
+
+#else
+#define INITERROR return
+
void
init_cracklib(void)
+#endif
{
- Py_InitModule3("_cracklib", _cracklibmethods, _cracklib_doc);
+#ifdef IS_PY3K
+ PyObject *module = PyModule_Create(&moduledef);
+#else
+ PyObject *module = Py_InitModule3("_cracklib", _cracklibmethods, _cracklib_doc);
+#endif
+ if (module == NULL)
+ INITERROR;
+#ifdef IS_PY3K
+ return module;
+#endif
}