From ea7336fe7b642922e6dc3499b5cd6316786b6024 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Mon, 16 May 2016 12:41:43 -0700 Subject: ignore modules starting with '.' when importing Sometimes the backups are stored in the same directory by text editors as dotfiles which leads to ImportError. --- src/mailman/utilities/modules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mailman/utilities/modules.py b/src/mailman/utilities/modules.py index 88639a881..b16aa45e5 100644 --- a/src/mailman/utilities/modules.py +++ b/src/mailman/utilities/modules.py @@ -91,7 +91,7 @@ def find_components(package, interface): """ for filename in resource_listdir(package, ''): basename, extension = os.path.splitext(filename) - if extension != '.py': + if extension != '.py' or basename.startswith('.'): continue module_name = '{}.{}'.format(package, basename) __import__(module_name, fromlist='*') -- cgit v1.3.1