diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-10-28 18:06:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-10-28 18:14:53 +0300 |
commit | 9267e6275cc925ec3476b0a810e840cefd658170 (patch) | |
tree | 2d4a251c81298472ba46569d5332434e170cb12c | |
parent | d310cbfa0fd0c424addf3f10c215869b790e3214 (diff) |
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.
-rw-r--r-- | release/scripts/modules/bpy/path.py | 3 |
1 files changed, 2 insertions, 1 deletions
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): |