From 1ca7756dc1e5ca7cda2b4f9aef9826db7061aeb5 Mon Sep 17 00:00:00 2001 From: Richard Larkin Date: Tue, 12 Jul 2016 15:36:45 +0200 Subject: [PATCH] Fixed filename extention matching. closes #193 --- toolchain.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolchain.py b/toolchain.py index 8965dd5..804bf96 100755 --- a/toolchain.py +++ b/toolchain.py @@ -835,12 +835,12 @@ class PythonRecipe(Recipe): self.install_python_package() self.reduce_python_package() - def remove_junk(self, d): - exts = ["pyc", "py", "so.lib", "so.o", "sh"] + @staticmethod + def remove_junk(d): + exts = [".pyc", ".py", ".so.lib", ".so.o", ".sh"] for root, dirnames, filenames in walk(d): for fn in filenames: - ext = fn.rsplit(".", 1)[-1] - if ext in exts: + if any([fn.endswith(ext) for ext in exts]): unlink(join(root, fn)) def install_python_package(self, name=None, env=None, is_dir=True):