PyAPI: change behavior of bpy.path.module_names

Instead of checking for names that contain ".", only skip files
that start with a "." (since they're used for ".git" & ".arcconfig").

While other path names may fail to import, it's not the purpose of this
function to validate the path, have the caller must raise an error
instead of silently skipping them.

See D6140.
This commit is contained in:
Campbell Barton 2019-10-29 02:06:10 +11:00
parent d310cbfa0f
commit 9267e6275c
1 changed files with 2 additions and 1 deletions

View File

@ -352,7 +352,8 @@ def module_names(path, recursive=False):
elif filename.endswith(".py") and filename != "__init__.py":
fullpath = join(path, filename)
modules.append((filename[0:-3], fullpath))
elif "." not in filename:
elif not filename.startswith("."):
# Skip hidden files since they are used by for version control.
directory = join(path, filename)
fullpath = join(directory, "__init__.py")
if isfile(fullpath):