From 46d7c0ad680cf73a9014e6b7669c22346f64c912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Randy=20D=C3=B6ring?= <30527984+radoering@users.noreply.github.com> Date: Fri, 19 Jun 2026 10:08:27 +0200 Subject: [PATCH] perf: avoid building a Path object for each record entry Splitting record entry paths by "/" should be safe because path separators are normalized in `parse_record_file`. --- src/installer/_core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/installer/_core.py b/src/installer/_core.py index e23f06e..a33011b 100644 --- a/src/installer/_core.py +++ b/src/installer/_core.py @@ -3,7 +3,6 @@ import posixpath import warnings from io import BytesIO -from pathlib import Path from typing import cast from installer.destinations import WheelDestination @@ -102,7 +101,7 @@ def install( if path == record_file_path: continue - if "__pycache__" in Path(path).parts[:-1]: + if "__pycache__" in path.split("/")[:-1]: warnings.warn( ( f"Skip installing {path} from {source.distribution}."