summaryrefslogtreecommitdiffstats
path: root/test/functional/util/dummy_killer.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/util/dummy_killer.py')
-rw-r--r--test/functional/util/dummy_killer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/util/dummy_killer.py b/test/functional/util/dummy_killer.py
index 6b3181608..0a052fb3e 100644
--- a/test/functional/util/dummy_killer.py
+++ b/test/functional/util/dummy_killer.py
@@ -1,6 +1,7 @@
import signal
import os
import atexit
+import tempfile
def setup_killer(server, method = None):
def default_method():
@@ -18,9 +19,10 @@ def setup_killer(server, method = None):
def write_pid(path):
- with open(path, 'w+') as f:
+ with tempfile.NamedTemporaryFile(mode='w', delete=False) as f:
f.write(str(os.getpid()))
f.close()
+ os.rename(f.name, path)
def cleanup():
os.remove(path)