Skip to content

Commit d5996d8

Browse files
committed
pylint fixes
1 parent b320ee5 commit d5996d8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@
4747
CONFIGURATION_DEFAULT_MULTI, CONFIGURATION_SANDBOXED_MULTI, CONFIGURATION_NATIVE_MULTI
4848

4949

50-
try:
51-
import __main__ # workaround for pdb++
52-
except ImportError:
50+
if not sys.modules.get("__main__"):
51+
# workaround for pdb++
5352
sys.modules["__main__"] = type(sys)("<empty>")
5453

5554

@@ -1151,7 +1150,7 @@ def _prepare_headers(self):
11511150
# This should only be done for the base task, otherwise we'll duplicate
11521151
# the work. This is a development-time thing, because we need the
11531152
# 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;
11551154
target_dir = os.path.join(SUITE.dir, "graalpython", "include")
11561155
if os.path.exists(target_dir):
11571156
shutil.rmtree(target_dir)
@@ -1169,7 +1168,6 @@ def build(self):
11691168
args.append("-q")
11701169
args += ["-S", os.path.join(self.src_dir(), "setup.py"), self.subject.get_output_root()]
11711170
mx.ensure_dir_exists(cwd)
1172-
home = os.path.join(SUITE.dir, "graalpython")
11731171
rc = self.run(args, env=env, cwd=cwd)
11741172
shutil.rmtree(cwd) # remove the temporary build files
11751173
return min(rc, 1)
@@ -1180,15 +1178,15 @@ def src_dir(self):
11801178
def needsBuild(self, newestInput):
11811179
tsNewest = 0
11821180
newestFile = None
1183-
for root,dirs,files in os.walk(self.src_dir()):
1181+
for root, _, files in os.walk(self.src_dir()):
11841182
for f in files:
11851183
ts = os.path.getmtime(os.path.join(root, f))
11861184
if tsNewest < ts:
11871185
tsNewest = ts
11881186
newestFile = f
11891187
tsOldest = sys.maxsize
11901188
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()):
11921190
for f in files:
11931191
ts = os.path.getmtime(os.path.join(root, f))
11941192
if tsOldest > ts:
@@ -1229,7 +1227,7 @@ def getArchivableResults(self, use_relpath=True, single=False):
12291227
if single:
12301228
raise ValueError("single not supported")
12311229
output = self.getOutput()
1232-
for root,dirs,files in os.walk(output):
1230+
for root, _, files in os.walk(output):
12331231
for name in files:
12341232
fullname = os.path.join(root, name)
12351233
if use_relpath:

0 commit comments

Comments
 (0)