Skip to content

Commit 420c655

Browse files
committed
Do not generate *.pyc files at all; use /dev/null if possible
1 parent d5bb132 commit 420c655

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,12 @@ def build(self):
16901690
mx.ensure_dir_exists(os.path.join(self.subject.get_output_root(), "modules"))
16911691

16921692
cwd = os.path.join(self.subject.get_output_root(), "mxbuild_temp")
1693-
pycache_dir = os.path.join(self.subject.get_output_root(), "__pycache__")
1693+
1694+
if os.path.exists("/dev/null"):
1695+
pycache_dir = "/dev/null"
1696+
else:
1697+
pycache_dir = os.path.join(self.subject.get_output_root(), "__pycache__")
1698+
16941699
args = []
16951700
if mx._opts.verbose:
16961701
args.append("-v")
@@ -1700,6 +1705,7 @@ def build(self):
17001705

17011706
args += ["--python.WithThread",
17021707
"--python.PyCachePrefix=" + pycache_dir,
1708+
"-B",
17031709
"-S", os.path.join(self.src_dir() , "setup.py"),
17041710
self.subject.get_output_root()]
17051711
mx.ensure_dir_exists(cwd)

0 commit comments

Comments
 (0)