[PATCH 3/3] Do not try importing hidden/backup files as formats

Vratislav Podzimek vpodzime at redhat.com
Fri Apr 10 14:29:11 UTC 2015


These may come from editors and other tools.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 blivet/formats/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py
index 4bd9105..5e48978 100644
--- a/blivet/formats/__init__.py
+++ b/blivet/formats/__init__.py
@@ -104,7 +104,7 @@ def collect_device_format_classes():
     (myfile_name, _ext) = os.path.splitext(myfile)
     for module_file in os.listdir(mydir):
         (mod_name, ext) = os.path.splitext(module_file)
-        if ext == ".py" and mod_name != myfile_name:
+        if ext == ".py" and mod_name != myfile_name and not mod_name.startswith("."):
             try:
                 globals()[mod_name] = __import__(mod_name, globals(), locals(), [], -1)
             except ImportError:
-- 
2.1.0



More information about the anaconda-patches mailing list