Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
b37d5536
Commit
b37d5536
authored
14 years ago
by
Doug Hammond
Browse files
Options
Downloads
Patches
Plain Diff
extensions_framework: make util.path_relative_to_export more robust on win32
parent
9d2ee805
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/extensions_framework/util.py
+8
-1
8 additions, 1 deletion
modules/extensions_framework/util.py
with
8 additions
and
1 deletion
modules/extensions_framework/util.py
+
8
−
1
View file @
b37d5536
...
...
@@ -52,8 +52,15 @@ def path_relative_to_export(p):
"""
Return a path that is relative to the export path
"""
global
export_path
p
=
filesystem_path
(
p
)
ep
=
os
.
path
.
dirname
(
export_path
)
if
os
.
sys
.
platform
==
'
win32
'
:
# Prevent an error whereby python thinks C: and c: are different drives
if
p
[
1
]
==
'
:
'
:
p
=
p
[
0
].
lower
()
+
p
[
1
:]
if
ep
[
1
]
==
'
:
'
:
ep
=
ep
[
0
].
lower
()
+
ep
[
1
:]
try
:
relp
=
os
.
path
.
relpath
(
p
,
os
.
path
.
dirname
(
export_path
)
)
relp
=
os
.
path
.
relpath
(
p
,
ep
)
except
ValueError
:
# path on different drive on windows
relp
=
p
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment