Skip to content

Commit 2ac4ca5

Browse files
committed
simplify import update script
1 parent 36cbc68 commit 2ac4ca5

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,16 @@ def update_import(name, rev="origin/master", callback=None):
620620

621621
def update_import_cmd(args):
622622
"""Update our mx imports"""
623-
if "sulong" in args or "regex" in args or "truffle" in args:
623+
if not args:
624+
args = ["truffle"]
625+
if "sulong" in args:
626+
args.append("regex")
627+
if "regex" in args:
628+
args.append("sulong")
629+
if "truffle" in args:
630+
args.remove("truffle")
631+
args += ["sulong", "regex"]
632+
if "sulong" in args:
624633
join = os.path.join
625634
callback = lambda: shutil.copy(
626635
join(mx.dependency("SULONG_LEGACY").output, "include", "truffle.h"),
@@ -629,16 +638,9 @@ def update_import_cmd(args):
629638
join(mx.dependency("SULONG_LIBS").output, "polyglot.h"),
630639
join(SUITE.dir, "graalpython", "com.oracle.graal.python.cext", "include", "polyglot.h")
631640
)
632-
update_import("sulong", callback=callback)
633-
update_import("regex")
634-
try: args.remove("sulong")
635-
except ValueError: pass
636-
try: args.remove("truffle")
637-
except ValueError: pass
638-
try: args.remove("regex")
639-
except ValueError: pass
640-
641-
for name in args:
641+
else:
642+
callback = None
643+
for name in set(args):
642644
update_import(name, callback=callback)
643645

644646

0 commit comments

Comments
 (0)