Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-09-03 14:58:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-09-03 14:58:11 +0300
commit73b34ad06b770f1a9b4022ab9863efa80b003ae3 (patch)
tree78c2a7f3e8589b70b0102968bb3997228ca0cd48 /release/scripts/modules/bpy/path.py
parent8383a2d4cc32c8516f11364aae079aeae93116c9 (diff)
PyAPI: tweak to ensure_ext don't lower entire path
Diffstat (limited to 'release/scripts/modules/bpy/path.py')
-rw-r--r--release/scripts/modules/bpy/path.py9
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