@@ -1146,12 +1146,15 @@ def __str__(self):
1146
1146
def run (self , args , env , cwd ):
1147
1147
return do_run_python (args , env = env , cwd = cwd )
1148
1148
1149
+ def _dev_headers_dir (self ):
1150
+ return os .path .join (SUITE .dir , "graalpython" , "include" )
1151
+
1149
1152
def _prepare_headers (self ):
1150
1153
# This should only be done for the base task, otherwise we'll duplicate
1151
1154
# the work. This is a development-time thing, because we need the
1152
1155
# include directory for the C API to be next to lib-graalpython
1153
1156
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 ( )
1155
1158
if os .path .exists (target_dir ):
1156
1159
shutil .rmtree (target_dir )
1157
1160
shutil .copytree (os .path .join (self .src_dir (), "include" ), target_dir )
@@ -1207,11 +1210,16 @@ def newestOutput(self):
1207
1210
return None
1208
1211
1209
1212
def clean (self , forBuild = False ):
1213
+ result = 0
1214
+ try :
1215
+ shutil .rmtree (self ._dev_headers_dir ())
1216
+ except BaseException :
1217
+ result = 1
1210
1218
try :
1211
1219
shutil .rmtree (self .subject .get_output_root ())
1212
1220
except BaseException :
1213
- return 1
1214
- return 0
1221
+ result = 1
1222
+ return result
1215
1223
1216
1224
1217
1225
class GraalpythonCAPIProject (mx .Project ):
0 commit comments