Lines Matching refs:registry
99 PyObject *registry; in get_once_registry() local
102 registry = get_warnings_attr(&PyId_onceregistry, 0); in get_once_registry()
103 if (registry == NULL) { in get_once_registry()
109 if (!PyDict_Check(registry)) { in get_once_registry()
113 Py_TYPE(registry)->tp_name); in get_once_registry()
114 Py_DECREF(registry); in get_once_registry()
117 Py_SETREF(_PyRuntime.warnings.once_registry, registry); in get_once_registry()
118 return registry; in get_once_registry()
248 already_warned(PyObject *registry, PyObject *key, int should_set) in already_warned() argument
256 version_obj = _PyDict_GetItemId(registry, &PyId_version); in already_warned()
264 PyDict_Clear(registry); in already_warned()
268 if (_PyDict_SetItemId(registry, &PyId_version, version_obj) < 0) { in already_warned()
275 already_warned = PyDict_GetItem(registry, key); in already_warned()
285 return PyDict_SetItem(registry, key, Py_True); in already_warned()
324 update_registry(PyObject *registry, PyObject *text, PyObject *category, in update_registry() argument
335 rc = already_warned(registry, altkey, 1); in update_registry()
473 PyObject *module, PyObject *registry, PyObject *sourceline, in warn_explicit() argument
488 if (registry && !PyDict_Check(registry) && (registry != Py_None)) { in warn_explicit()
534 if ((registry != NULL) && (registry != Py_None)) { in warn_explicit()
535 rc = already_warned(registry, key, 0); in warn_explicit()
560 if (registry != NULL && registry != Py_None && in warn_explicit()
561 PyDict_SetItem(registry, key, Py_True) < 0) in warn_explicit()
567 if (registry == NULL || registry == Py_None) { in warn_explicit()
568 registry = get_once_registry(); in warn_explicit()
569 if (registry == NULL) in warn_explicit()
573 rc = update_registry(registry, text, category, 0); in warn_explicit()
577 if (registry != NULL && registry != Py_None) in warn_explicit()
578 rc = update_registry(registry, text, category, 0); in warn_explicit()
674 PyObject **module, PyObject **registry) in setup_context() argument
707 *registry = PyDict_GetItemString(globals, "__warningregistry__"); in setup_context()
708 if (*registry == NULL) { in setup_context()
711 *registry = PyDict_New(); in setup_context()
712 if (*registry == NULL) in setup_context()
715 rc = PyDict_SetItemString(globals, "__warningregistry__", *registry); in setup_context()
720 Py_INCREF(*registry); in setup_context()
803 Py_XDECREF(*registry); in setup_context()
841 PyObject *filename, *module, *registry, *res; in do_warn() local
844 if (!setup_context(stack_level, &filename, &lineno, &module, ®istry)) in do_warn()
847 res = warn_explicit(category, message, filename, lineno, module, registry, in do_warn()
850 Py_DECREF(registry); in do_warn()
947 PyObject *registry = NULL; in warnings_warn_explicit() local
955 ®istry, &module_globals, &sourceobj)) in warnings_warn_explicit()
972 registry, source_line, sourceobj); in warnings_warn_explicit()
1084 PyObject *module, PyObject *registry) in PyErr_WarnExplicitObject() argument
1090 module, registry, NULL, NULL); in PyErr_WarnExplicitObject()
1100 const char *module_str, PyObject *registry) in PyErr_WarnExplicit() argument
1116 module, registry); in PyErr_WarnExplicit()
1128 const char *module_str, PyObject *registry, in PyErr_WarnExplicitFormat() argument
1154 module, registry, NULL, NULL); in PyErr_WarnExplicitFormat()