From d2033aacea388df3845d6d3122679d0bd8e4cf4b Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 6 Feb 2020 23:21:27 +0200 Subject: [PATCH] Remove the entire folder with temp files used by pvs-studio tool --- platformio/commands/check/tools/pvsstudio.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/platformio/commands/check/tools/pvsstudio.py b/platformio/commands/check/tools/pvsstudio.py index bce4ae14..36ae2341 100644 --- a/platformio/commands/check/tools/pvsstudio.py +++ b/platformio/commands/check/tools/pvsstudio.py @@ -14,6 +14,7 @@ import os import tempfile +import shutil from xml.etree.ElementTree import fromstring import click @@ -193,15 +194,8 @@ class PvsStudioCheckTool(CheckToolBase): # pylint: disable=too-many-instance-at self._bad_input = True def clean_up(self): - temp_files = ( - self._tmp_output_file, - self._tmp_preprocessed_file, - self._tmp_cfg_file, - self._tmp_cmd_file, - ) - for f in temp_files: - if os.path.isfile(f): - os.remove(f) + if os.path.isdir(self._tmp_dir): + shutil.rmtree(self._tmp_dir) def check(self, on_defect_callback=None): self._on_defect_callback = on_defect_callback