From a8b4909aeb0de11a7bf29a51d5c1efb62f05a5dc Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Fri, 26 Feb 2021 14:44:11 +0100 Subject: [PATCH] Replace rstrip with correct handling --- idom/client/manage.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/idom/client/manage.py b/idom/client/manage.py index a81837e4f..5d30dcb6d 100644 --- a/idom/client/manage.py +++ b/idom/client/manage.py @@ -35,13 +35,16 @@ def web_module_exists(package_name: str) -> bool: def web_module_names() -> Set[str]: - return { - str(rel_pth.as_posix()).rstrip(".js") - for rel_pth in ( - pth.relative_to(WEB_MODULES_DIR) for pth in WEB_MODULES_DIR.glob("**/*.js") - ) - if Path("common") not in rel_pth.parents - } + names = [] + for pth in WEB_MODULES_DIR.glob("**/*.js"): + for rel_pth in pth.relative_to(WEB_MODULES_DIR): + if Path("common") not in rel_pth.parents: + continue + module_path = str(rel_pth.as_posix()) + if module_path.endswith('.js'): + module_path = module_path[:-3] + names.append(module_path) + return set(names) def add_web_module(package_name: str, source: Union[Path, str]) -> str: