From cae377495adfc2937d88e611cab85500844b4596 Mon Sep 17 00:00:00 2001 From: barneygale Date: Mon, 4 Dec 2023 01:34:41 +0000 Subject: [PATCH] Ensure has_trailing_sep is boolean --- Lib/pathlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 0f1b03f5f27f32..921c46098b7b5e 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -275,7 +275,7 @@ def _parse_path(cls, path): # e.g. //?/unc/server/share root = sep parsed = [sys.intern(str(x)) for x in rel.split(sep) if x and x != '.'] - has_trailing_sep = parsed and not rel.endswith(parsed[-1]) + has_trailing_sep = bool(parsed) and not rel.endswith(parsed[-1]) return drv, root, parsed, has_trailing_sep def _load_parts(self):