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>2012-03-16 08:14:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-16 08:14:57 +0400
commitc6c0601d8ea410494b59081152f3cc080a8f39a3 (patch)
tree1100a447f8e0d1f3a1d464db82a08344f08c7ab8 /release/scripts/modules/bpy
parent815beed922a4ffb68d2e35ee307775b4468045c8 (diff)
py api:
modify bpy.path.display_name_from_filepath() to accept bytes
Diffstat (limited to 'release/scripts/modules/bpy')
-rw-r--r--release/scripts/modules/bpy/path.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
index 98a3c81d65a..9a90797bf28 100644
--- a/release/scripts/modules/bpy/path.py
+++ b/release/scripts/modules/bpy/path.py
@@ -145,7 +145,10 @@ def display_name_from_filepath(name):
ensured to be utf8 compatible.
"""
name = _os.path.splitext(basename(name))[0]
- return name.encode("utf8", "replace").decode("utf8")
+ if type(name) == bytes:
+ return name.decode("utf8", "replace")
+ else:
+ return name.encode("utf8", "replace").decode("utf8")
def resolve_ncase(path):