From bb42b032c9f97026c34c3c270f30e599889dd525 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 11 Nov 2024 11:00:47 +0700 Subject: [PATCH] fix du calculation for plain files --- packaging/MSWindows/BUILD.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packaging/MSWindows/BUILD.py b/packaging/MSWindows/BUILD.py index d7a4650a4b..f00b6c0b65 100644 --- a/packaging/MSWindows/BUILD.py +++ b/packaging/MSWindows/BUILD.py @@ -122,6 +122,8 @@ def csv(values: Iterable) -> str: def du(path: str) -> int: + if os.path.isfile(path): + return os.path.getsize(path) return sum(os.path.getsize(f) for f in glob(f"{path}/**", recursive=True) if os.path.isfile(f))