mirror of
https://github.com/python/cpython.git
synced 2025-09-02 23:18:25 +00:00
Corran Webster: fix 'change_root()' to handle Mac OS paths.
This commit is contained in:
parent
55a8338d7f
commit
f5855746fe
1 changed files with 7 additions and 1 deletions
|
@ -100,7 +100,13 @@ def change_root (new_root, pathname):
|
|||
return os.path.join (new_root, path)
|
||||
|
||||
elif os.name == 'mac':
|
||||
raise RuntimeError, "no clue how to do this on Mac OS"
|
||||
if not os.path.isabs(pathname):
|
||||
return os.path.join(new_root, pathname)
|
||||
else:
|
||||
# Chop off volume name from start of path
|
||||
elements = string.split(pathname, ":", 1)
|
||||
pathname = ":" + elements[1]
|
||||
return os.path.join(new_root, pathname)
|
||||
|
||||
else:
|
||||
raise DistutilsPlatformError, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue