Skip to content

Commit

Permalink
Use Python functions to prep temp directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Jul 31, 2023
1 parent 07831ef commit c8ac39a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/cuml/benchmark/nvtx_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#

import os
import shutil
import sys
import tempfile
from subprocess import run
Expand All @@ -26,8 +27,8 @@ def __init__(self, tmp_path=None):
self.tmp_dir = tempfile.TemporaryDirectory(dir=tmp_path)
self.nsys_file = os.path.join(self.tmp_dir.name, "report.nsys-rep")
self.json_file = os.path.join(self.tmp_dir.name, "report.json")
self._execute(["rm", "-rf", self.tmp_dir.name])
self._execute(["mkdir", "-p", self.tmp_dir.name])
shutil.rmtree(self.tmp_dir.name)
os.makedirs(self.tmp_dir.name)

def __del__(self):
self.tmp_dir.cleanup()
Expand Down

0 comments on commit c8ac39a

Please sign in to comment.