From 73b34ad06b770f1a9b4022ab9863efa80b003ae3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 3 Sep 2015 21:58:11 +1000 Subject: [PATCH] PyAPI: tweak to ensure_ext don't lower entire path --- release/scripts/modules/bpy/path.py | 9 ++++++--- 1 file 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