From 1e33bc62ede982779102b015b4d311a3e4791031 Mon Sep 17 00:00:00 2001 From: JoeLametta Date: Fri, 14 May 2021 10:31:53 +0000 Subject: [PATCH] Make PathFilter's filter tolerant to empty strings Signed-off-by: JoeLametta --- whipper/common/path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whipper/common/path.py b/whipper/common/path.py index 3099bbd..94cad17 100644 --- a/whipper/common/path.py +++ b/whipper/common/path.py @@ -44,7 +44,7 @@ class PathFilter: def filter(self, path): R_CH = '_' if self._dot: - if path[0] == '.': + if path[:1] == '.': # Slicing tolerant to empty strings path = R_CH + path[1:] if self._posix: path = re.sub(r'[\/\x00]', R_CH, path)