Skip to content

Commit 6721396

Browse files
committed
clean also copied header files
1 parent de0500e commit 6721396

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,12 +1146,15 @@ def __str__(self):
11461146
def run(self, args, env, cwd):
11471147
return do_run_python(args, env=env, cwd=cwd)
11481148

1149+
def _dev_headers_dir(self):
1150+
return os.path.join(SUITE.dir, "graalpython", "include")
1151+
11491152
def _prepare_headers(self):
11501153
# This should only be done for the base task, otherwise we'll duplicate
11511154
# the work. This is a development-time thing, because we need the
11521155
# include directory for the C API to be next to lib-graalpython
11531156
if type(self) == GraalpythonCAPIBuildTask: # pylint: disable=unidiomatic-typecheck;
1154-
target_dir = os.path.join(SUITE.dir, "graalpython", "include")
1157+
target_dir = self._dev_headers_dir()
11551158
if os.path.exists(target_dir):
11561159
shutil.rmtree(target_dir)
11571160
shutil.copytree(os.path.join(self.src_dir(), "include"), target_dir)
@@ -1207,11 +1210,16 @@ def newestOutput(self):
12071210
return None
12081211

12091212
def clean(self, forBuild=False):
1213+
result = 0
1214+
try:
1215+
shutil.rmtree(self._dev_headers_dir())
1216+
except BaseException:
1217+
result = 1
12101218
try:
12111219
shutil.rmtree(self.subject.get_output_root())
12121220
except BaseException:
1213-
return 1
1214-
return 0
1221+
result = 1
1222+
return result
12151223

12161224

12171225
class GraalpythonCAPIProject(mx.Project):

0 commit comments

Comments
 (0)