diff -r 469ff344f8fd Objects/typeobject.c --- a/Objects/typeobject.c Sat Jan 31 12:20:40 2015 -0800 +++ b/Objects/typeobject.c Sun Feb 01 14:23:48 2015 +0200 @@ -2690,6 +2690,14 @@ PyType_FromSpecWithBases(PyType_Spec *sp _PyDict_SetItemId(type->tp_dict, &PyId___module__, PyUnicode_FromStringAndSize( spec->name, (Py_ssize_t)(s - spec->name))); + else { + if (PyErr_WarnFormat(PyExc_SyntaxWarning, 1, + "builtin type %.200s has no the __module__ attribute", + spec->name)) { + Py_DECREF(res); + return NULL; + } + } return (PyObject*)res;