Don't put __pycache__ dir in the file list

This prevents the loader from needlessly trying to process it (which
will fail anyway since it's not a file).
This commit is contained in:
Erik Johnson 2018-07-17 15:35:42 -05:00
parent e7c10196da
commit 4b95e5f313
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -1223,7 +1223,9 @@ class LazyLoader(salt.utils.lazy.LazyDict):
try:
# Make sure we have a sorted listdir in order to have
# expectable override results
files = sorted(os.listdir(mod_dir))
files = sorted(
x for x in os.listdir(mod_dir) if x != '__pycache__'
)
except OSError:
continue # Next mod_dir
if six.PY3: