From 9267e6275cc925ec3476b0a810e840cefd658170 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Oct 2019 02:06:10 +1100 Subject: 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. --- release/scripts/modules/bpy/path.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'release/scripts/modules') diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index 845475b9180..3860445233d 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -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): -- cgit v1.2.3