From 06964fee088311649424992aff4f499d94bca840 Mon Sep 17 00:00:00 2001 From: Moens Alexandre Date: Tue, 26 Apr 2022 12:45:51 +0000 Subject: [PATCH] [FIX] cloc: empty string in demo(_xml) or cloc_exclude Before this commit: calling `odoo-bin cloc -P ` when the manifest of a module includes an empty string in the demo, demo_xml or cloc_exclude entries, would result in a crash because an empty string is not an acceptable pattern for Path.glob to note: an empty string in those entries is technically wrong and will cause issue during module install, but that shouldn't prevent the cloc from giving correct results. closes odoo/odoo#90650 X-original-commit: 93318b22fc8b7cf6344f789d2c45fc3f5b3269eb Signed-off-by: Nicolas Lempereur (nle) Signed-off-by: Thibault Francois --- odoo/tools/cloc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/tools/cloc.py b/odoo/tools/cloc.py index fe76a3ee716..b93fb08bcd0 100644 --- a/odoo/tools/cloc.py +++ b/odoo/tools/cloc.py @@ -123,7 +123,7 @@ class Cloc(object): pass if not exclude: exclude = set() - for i in exclude_list: + for i in filter(None, exclude_list): exclude.update(str(p) for p in pathlib.Path(path).glob(i)) module_name = os.path.basename(path)