diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-04-30 16:40:05 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-04-30 16:40:05 +0200 |
commit | 6514a70318688a119405b83dbd4e3b8da45c3ee9 (patch) | |
tree | 237b2bb9a147e8189a575dc625cfbc92649fb595 | |
parent | 74088363e42e83efa93d64a139f9c1c1136f11de (diff) | |
download | psutil-6514a70318688a119405b83dbd4e3b8da45c3ee9.tar.gz |
rm get_testfn()
-rw-r--r-- | psutil/tests/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index c865edab..8db01587 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -385,7 +385,7 @@ def create_zombie_proc(): s.sendall(pid) """ % unix_file) sock = bind_unix_socket(unix_file) - with contextlib.closing(sock): + try: sock.settimeout(GLOBAL_TIMEOUT) parent = pyrun(src) conn, _ = sock.accept() @@ -398,6 +398,9 @@ def create_zombie_proc(): return (parent, zombie) finally: conn.close() + finally: + sock.close() + safe_rmpath(unix_file) @_reap_children_on_err |