Skip to content

Commit 08de5c3

Browse files
committed
fix: temp file leak
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
1 parent 4cc0482 commit 08de5c3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/test_profiling/test_sampling_profiler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3018,13 +3018,15 @@ def worker(x):
30183018
script_file.flush()
30193019
script_name = script_file.name
30203020

3021+
self.addCleanup(os.unlink, script_name)
3022+
30213023
result = subprocess.run(
30223024
[
30233025
sys.executable,
30243026
"-m", "profiling.sampling.sample",
30253027
"-d", "1",
30263028
"-i", "100000",
3027-
script_name
3029+
script_name,
30283030
],
30293031
capture_output=True,
30303032
text=True,

0 commit comments

Comments
 (0)