summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-27 11:11:55 (GMT)
committerGitHub <noreply@github.com>2017-11-27 11:11:55 (GMT)
commit21c7730761e2a768e33b89b063a095d007dcfd2c (patch)
tree1d96b9b8c87ed00337e15d2a8c1f287fac4ffcb1 /Python
parentc172fc5031a4035986bef0b2fcef906706d7abf3 (diff)
downloadcpython-21c7730761e2a768e33b89b063a095d007dcfd2c.zip
cpython-21c7730761e2a768e33b89b063a095d007dcfd2c.tar.gz
cpython-21c7730761e2a768e33b89b063a095d007dcfd2c.tar.bz2
bpo-32089: Use default action for ResourceWarning (#4584)
In development and debug mode, use the "default" action, rather than the "always" action, for ResourceWarning in the default warnings filters.
Diffstat (limited to 'Python')
-rw-r--r--Python/_warnings.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 086a70d..27f5b81 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -13,7 +13,6 @@ _Py_IDENTIFIER(argv);
_Py_IDENTIFIER(stderr);
_Py_IDENTIFIER(ignore);
_Py_IDENTIFIER(error);
-_Py_IDENTIFIER(always);
_Py_static_string(PyId_default, "default");
static int
@@ -1208,9 +1207,9 @@ init_filters(const _PyCoreConfig *config)
_Py_Identifier *resource_action;
/* resource usage warnings are enabled by default in pydebug mode */
#ifdef Py_DEBUG
- resource_action = &PyId_always;
+ resource_action = &PyId_default;
#else
- resource_action = (dev_mode ? &PyId_always : &PyId_ignore);
+ resource_action = (dev_mode ? &PyId_default: &PyId_ignore);
#endif
PyList_SET_ITEM(filters, pos++, create_filter(PyExc_ResourceWarning,
resource_action));