Skip to content

Commit de4c7d1

Browse files
committed
Do not clean pyc files on specific clean command
1 parent 0b1ca87 commit de4c7d1

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2684,14 +2684,15 @@ def getBuildEnv(self, replaceVar=mx_subst.path_substitutions):
26842684
orig_clean = mx.command_function("clean")
26852685
def python_clean(args):
26862686
orig_clean(args)
2687-
count = 0
2688-
for path in os.walk(SUITE.dir):
2689-
for file in glob.iglob(os.path.join(path[0], '*.pyc')):
2690-
count += 1
2691-
os.remove(file)
2692-
2693-
if count > 0:
2694-
print('Cleaning', count, "`*.pyc` files...")
2687+
if not args:
2688+
count = 0
2689+
for path in os.walk(SUITE.dir):
2690+
for file in glob.iglob(os.path.join(path[0], '*.pyc')):
2691+
count += 1
2692+
os.remove(file)
2693+
2694+
if count > 0:
2695+
print('Cleaning', count, "`*.pyc` files...")
26952696

26962697
def update_hpy_import_cmd(args):
26972698
"""Update our import of HPy sources."""

0 commit comments

Comments
 (0)