mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
PyAPI: tweak to ensure_ext don't lower entire path
This commit is contained in:
parent
8383a2d4cc
commit
73b34ad06b
1 changed files with 6 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue