Skip to content

Commit bf827d4

Browse files
committed
check if import hook exists before running it
1 parent ad4b38f commit bf827d4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -867,10 +867,9 @@ def update_import_cmd(args):
867867

868868
# now allow dependent repos to hook into update
869869
for repo in repos:
870-
mx.run_mx([
871-
"%s-update-import" % os.path.basename(repo),
872-
"--overlaydir=%s" % overlaydir,
873-
], suite=repo, nonZeroIsFatal=False)
870+
cmdname = "%s-update-import" % os.path.basename(repo)
871+
if mx.run_mx(["help", cmdname], nonZeroIsFatal=False, quiet=True) == 0:
872+
mx.run_mx([cmdname, "--overlaydir=%s" % overlaydir], suite=repo, nonZeroIsFatal=True)
874873

875874
# update ci import in all our repos, commit the full update, and push verbosely
876875
prev_verbosity = mx._opts.very_verbose

0 commit comments

Comments
 (0)