From fdd3f35b61d816e1e9c22f92d36cfe89f6277f95 Mon Sep 17 00:00:00 2001 From: ayeteadoe Date: Thu, 22 May 2025 12:46:50 -0700 Subject: [PATCH] Meta: Localize resource module import to fix ladybird.py on Windows --- Meta/ladybird.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Meta/ladybird.py b/Meta/ladybird.py index c3de1056cbe..61349d8f3c0 100755 --- a/Meta/ladybird.py +++ b/Meta/ladybird.py @@ -6,7 +6,6 @@ import multiprocessing import os import platform import re -import resource import shutil import subprocess import sys @@ -271,6 +270,11 @@ def configure_main(platform: Platform, preset: str, cc: str, cxx: str) -> Path: def configure_skia_jemalloc() -> list[str]: + # NOTE: The resource module is only available on Unix, see the "Availability" section at + # https://docs.python.org/3/library/resource.html. Given Windows never calls this function, we import locally + # instead. + import resource + page_size = resource.getpagesize() gn = shutil.which("gn") or None