diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-03-19 01:01:48 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-03-19 01:01:48 (GMT) |
commit | f664dc58344fc615f8f5649752bf5cb54efe5b3b (patch) | |
tree | 33168a0657832d06ceb69098b13108ffa93046ef /Modules/socketmodule.c | |
parent | eedf13fe231b49b10c9a836ae8c9120d215deb84 (diff) | |
download | cpython-f664dc58344fc615f8f5649752bf5cb54efe5b3b.zip cpython-f664dc58344fc615f8f5649752bf5cb54efe5b3b.tar.gz cpython-f664dc58344fc615f8f5649752bf5cb54efe5b3b.tar.bz2 |
ResourceWarning: Revert change on socket and scandir
io.FileIO has a safe implementation of destructor, but not socket nor scandir.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 657b04b..77a6b31 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -4170,7 +4170,8 @@ sock_dealloc(PySocketSockObject *s) Py_ssize_t old_refcount = Py_REFCNT(s); ++Py_REFCNT(s); PyErr_Fetch(&exc, &val, &tb); - if (PyErr_ResourceWarning(s, 1, "unclosed %R", s)) + if (PyErr_WarnFormat(PyExc_ResourceWarning, 1, + "unclosed %R", s)) /* Spurious errors can appear at shutdown */ if (PyErr_ExceptionMatches(PyExc_Warning)) PyErr_WriteUnraisable((PyObject *) s); |