diff -r 61c4dbec2e2c Modules/posixmodule.c --- a/Modules/posixmodule.c Sat Aug 13 05:38:18 2016 +0300 +++ b/Modules/posixmodule.c Sat Aug 13 21:51:37 2016 +0800 @@ -13355,6 +13355,8 @@ Py_DECREF(unicode); } PyModule_AddObject(m, "_have_functions", list); + + Py_INCREF((PyObject *) &DirEntryType); PyModule_AddObject(m, "DirEntry", (PyObject *)&DirEntryType); initialized = 1;