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:
authorBastien Montagne <montagne29@wanadoo.fr>2013-08-18 19:17:33 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-08-18 19:17:33 +0400
commita567dd20c0a1ecfd690af40474640b8a3d9afa50 (patch)
treee88f4d835a411ebedd3a0db8bbf0085d61fb3dec /release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
parentc5e14f62a673507a6298bf9f676f6de11d193f07 (diff)
More "relpath" try/except protection...
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/bl_extract_messages.py')
-rw-r--r--release/scripts/modules/bl_i18n_utils/bl_extract_messages.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
index 3d00815b70e..e9ed9a8de5b 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
@@ -410,9 +410,15 @@ def dump_py_messages_from_files(msgs, reports, files, settings):
def make_rel(path):
for rp in root_paths:
if path.startswith(rp):
- return os.path.relpath(path, rp)
+ try: # can't always find the relative path (between drive letters on windows)
+ return os.path.relpath(path, rp)
+ except ValueError:
+ return path
# Use binary's dir as fallback...
- return os.path.relpath(path, os.path.dirname(bpy.app.binary_path))
+ try: # can't always find the relative path (between drive letters on windows)
+ return os.path.relpath(path, os.path.dirname(bpy.app.binary_path))
+ except ValueError:
+ return path
# Helper function
def extract_strings_ex(node, is_split=False):
@@ -768,7 +774,10 @@ def dump_src_messages(msgs, reports, settings):
if os.path.splitext(fname)[1] not in settings.PYGETTEXT_ALLOWED_EXTS:
continue
path = os.path.join(root, fname)
- rel_path = os.path.relpath(path, settings.SOURCE_DIR)
+ try: # can't always find the relative path (between drive letters on windows)
+ rel_path = os.path.relpath(path, settings.SOURCE_DIR)
+ except ValueError:
+ rel_path = path
if rel_path in forbidden:
continue
elif rel_path not in forced: