Index: Python/_warnings.c =================================================================== --- Python/_warnings.c (revision 76258) +++ Python/_warnings.c (working copy) @@ -839,26 +839,29 @@ static PyObject * init_filters(void) { - PyObject *filters = PyList_New(3); + PyObject *filters = PyList_New(4); const char *bytes_action; if (filters == NULL) return NULL; PyList_SET_ITEM(filters, 0, + create_filter(PyExc_DeprecationWarning, "ignore")); + PyList_SET_ITEM(filters, 1, create_filter(PyExc_PendingDeprecationWarning, "ignore")); - PyList_SET_ITEM(filters, 1, create_filter(PyExc_ImportWarning, "ignore")); + PyList_SET_ITEM(filters, 2, create_filter(PyExc_ImportWarning, "ignore")); if (Py_BytesWarningFlag > 1) bytes_action = "error"; else if (Py_BytesWarningFlag) bytes_action = "default"; else bytes_action = "ignore"; - PyList_SET_ITEM(filters, 2, create_filter(PyExc_BytesWarning, + PyList_SET_ITEM(filters, 3, create_filter(PyExc_BytesWarning, bytes_action)); if (PyList_GET_ITEM(filters, 0) == NULL || PyList_GET_ITEM(filters, 1) == NULL || - PyList_GET_ITEM(filters, 2) == NULL) { + PyList_GET_ITEM(filters, 2) == NULL || + PyList_GET_ITEM(filters, 3) == NULL) { Py_DECREF(filters); return NULL; } Index: Lib/warnings.py =================================================================== --- Lib/warnings.py (revision 76258) +++ Lib/warnings.py (working copy) @@ -383,8 +383,8 @@ # Module initialization _processoptions(sys.warnoptions) if not _warnings_defaults: - simplefilter("ignore", category=PendingDeprecationWarning, append=1) - simplefilter("ignore", category=ImportWarning, append=1) + for cls in (DeprecationWarning, PendingDeprecationWarning, ImportWarning): + simplefilter("ignore", category=cls, append=1) bytes_warning = sys.flags.bytes_warning if bytes_warning > 1: bytes_action = "error"