[PATCH 3/3] Do not try importing hidden/backup files as formats
Anne Mulhern
amulhern at redhat.com
Fri Apr 10 14:40:06 UTC 2015
ACK.
----- Original Message -----
> From: "Vratislav Podzimek" <vpodzime at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Friday, April 10, 2015 10:29:11 AM
> Subject: [PATCH 3/3] Do not try importing hidden/backup files as formats
>
> 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
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
More information about the anaconda-patches
mailing list