From 5ee720e3ba745cca4ad2e84fe4508a1e55e5aae5 Mon Sep 17 00:00:00 2001 From: lzmartinico Date: Sun, 24 Feb 2019 17:55:31 +0000 Subject: [PATCH] Exclude hidden files from being imported as modules --- seq2seq/models/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seq2seq/models/__init__.py b/seq2seq/models/__init__.py index 40327b0..6483dfc 100644 --- a/seq2seq/models/__init__.py +++ b/seq2seq/models/__init__.py @@ -42,6 +42,6 @@ def register_model_arch_fn(fn): # Automatically import any Python files in the models/ directory for file in os.listdir(os.path.dirname(__file__)): - if file.endswith('.py') and not file.startswith('_'): + if file.endswith('.py') and not (file.startswith('_') or file.startswith('.')): module = file[:file.find('.py')] importlib.import_module('seq2seq.models.' + module)