diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-09-03 14:58:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-09-03 14:58:11 +0300 |
commit | 73b34ad06b770f1a9b4022ab9863efa80b003ae3 (patch) | |
tree | 78c2a7f3e8589b70b0102968bb3997228ca0cd48 /release | |
parent | 8383a2d4cc32c8516f11364aae079aeae93116c9 (diff) |
PyAPI: tweak to ensure_ext don't lower entire path
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bpy/path.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index c31188a49fd..d7c6101115d 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -290,9 +290,12 @@ def ensure_ext(filepath, ext, case_sensitive=False): :type case_sensitive: bool """ - if ((case_sensitive and filepath.endswith(ext)) or - (not case_sensitive and filepath.lower().endswith(ext.lower()))): - return filepath + if case_sensitive: + if filepath.endswith(ext): + return filepath + else: + if filepath[-len(ext):].lower().endswith(ext.lower()): + return filepath return filepath + ext |