From 16feb0b979404a87f8c86f6282065530cf527d70 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 21 May 2025 16:05:14 -0400 Subject: [PATCH] Meta: Move ladybird.py imports to the top of the file There's no measurable benefit to hiding these in functions, even if they are only used once (or not at all). Only the BuildVcpkg import is left alone, as that function does some sys.path manipulation first. --- Meta/ladybird.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Meta/ladybird.py b/Meta/ladybird.py index e425a3deeb0..5f7a01fe879 100755 --- a/Meta/ladybird.py +++ b/Meta/ladybird.py @@ -1,14 +1,17 @@ #!/usr/bin/env python3 import argparse -import os -import re -import sys -import shutil import multiprocessing -from pathlib import Path +import os +import platform +import re +import resource +import shutil import subprocess +import sys + from enum import IntEnum +from pathlib import Path class HostArchitecture(IntEnum): @@ -26,8 +29,6 @@ class HostSystem(IntEnum): class Platform: def __init__(self): - import platform - self.system = platform.system() if self.system == "Windows": self.host_system = HostSystem.Windows @@ -250,8 +251,6 @@ def configure_main(platform, **kwargs): def configure_skia_jemalloc(): - import resource - page_size = resource.getpagesize() gn = shutil.which("gn") or None # https://github.com/LadybirdBrowser/ladybird/issues/261