Skip to content
Snippets Groups Projects
Commit f0125959 authored by Moens Alexandre's avatar Moens Alexandre
Browse files

[FIX] cloc: empty string in demo(_xml) or cloc_exclude


Before this commit:
calling `odoo-bin cloc -P <path_to_a_module>` 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#90583

X-original-commit: 93318b22
Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: default avatarThibault Francois <tfr@odoo.com>
parent 84cbb5cc
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment