Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wasm_build.py: keep support with old Python
  • Loading branch information
vstinner committed Sep 30, 2023
commit 6c336bc0a43ff0453bfe9258bcbb68c94c74b112
6 changes: 5 additions & 1 deletion Tools/wasm/wasm_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,11 @@ def make_cmd(self) -> List[str]:
def getenv(self) -> Dict[str, Any]:
"""Generate environ dict for platform"""
env = os.environ.copy()
env.setdefault("MAKEFLAGS", f"-j{os.process_cpu_count()}")
if hasattr(os, 'process_cpu_count'):
cpu_count = os.process_cpu_count()
else:
cpu_count = os.cpu_count()
env.setdefault("MAKEFLAGS", f"-j{cpu_count}")
platenv = self.host.platform.getenv(self)
for key, value in platenv.items():
if value is None:
Expand Down