47
47
CONFIGURATION_DEFAULT_MULTI , CONFIGURATION_SANDBOXED_MULTI , CONFIGURATION_NATIVE_MULTI
48
48
49
49
50
- try :
51
- import __main__ # workaround for pdb++
52
- except ImportError :
50
+ if not sys .modules .get ("__main__" ):
51
+ # workaround for pdb++
53
52
sys .modules ["__main__" ] = type (sys )("<empty>" )
54
53
55
54
@@ -1151,7 +1150,7 @@ def _prepare_headers(self):
1151
1150
# This should only be done for the base task, otherwise we'll duplicate
1152
1151
# the work. This is a development-time thing, because we need the
1153
1152
# include directory for the C API to be next to lib-graalpython
1154
- if type (self ) == GraalpythonCAPIBuildTask :
1153
+ if type (self ) == GraalpythonCAPIBuildTask : # pylint: disable=unidiomatic-typecheck;
1155
1154
target_dir = os .path .join (SUITE .dir , "graalpython" , "include" )
1156
1155
if os .path .exists (target_dir ):
1157
1156
shutil .rmtree (target_dir )
@@ -1169,7 +1168,6 @@ def build(self):
1169
1168
args .append ("-q" )
1170
1169
args += ["-S" , os .path .join (self .src_dir (), "setup.py" ), self .subject .get_output_root ()]
1171
1170
mx .ensure_dir_exists (cwd )
1172
- home = os .path .join (SUITE .dir , "graalpython" )
1173
1171
rc = self .run (args , env = env , cwd = cwd )
1174
1172
shutil .rmtree (cwd ) # remove the temporary build files
1175
1173
return min (rc , 1 )
@@ -1180,15 +1178,15 @@ def src_dir(self):
1180
1178
def needsBuild (self , newestInput ):
1181
1179
tsNewest = 0
1182
1180
newestFile = None
1183
- for root ,dirs , files in os .walk (self .src_dir ()):
1181
+ for root , _ , files in os .walk (self .src_dir ()):
1184
1182
for f in files :
1185
1183
ts = os .path .getmtime (os .path .join (root , f ))
1186
1184
if tsNewest < ts :
1187
1185
tsNewest = ts
1188
1186
newestFile = f
1189
1187
tsOldest = sys .maxsize
1190
1188
oldestFile = None
1191
- for root ,dirs , files in os .walk (self .subject .get_output_root ()):
1189
+ for root , _ , files in os .walk (self .subject .get_output_root ()):
1192
1190
for f in files :
1193
1191
ts = os .path .getmtime (os .path .join (root , f ))
1194
1192
if tsOldest > ts :
@@ -1229,7 +1227,7 @@ def getArchivableResults(self, use_relpath=True, single=False):
1229
1227
if single :
1230
1228
raise ValueError ("single not supported" )
1231
1229
output = self .getOutput ()
1232
- for root ,dirs , files in os .walk (output ):
1230
+ for root , _ , files in os .walk (output ):
1233
1231
for name in files :
1234
1232
fullname = os .path .join (root , name )
1235
1233
if use_relpath :
0 commit comments