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:
parent
d310cbfa0f
commit
9267e6275c
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue