mirror of
https://github.com/python/cpython.git
synced 2025-09-16 05:36:29 +00:00
removed sys.platform == 'mac' usage in distutils.dir_util
This commit is contained in:
parent
016828d119
commit
294c9d90df
2 changed files with 14 additions and 11 deletions
|
@ -212,14 +212,11 @@ def remove_tree (directory, verbose=1, dry_run=0):
|
|||
exc, "error removing %s: " % directory))
|
||||
|
||||
|
||||
def ensure_relative (path):
|
||||
def ensure_relative(path):
|
||||
"""Take the full path 'path', and make it a relative path so
|
||||
it can be the second argument to os.path.join().
|
||||
"""
|
||||
drive, path = os.path.splitdrive(path)
|
||||
if sys.platform == 'mac':
|
||||
return os.sep + path
|
||||
else:
|
||||
if path[0:1] == os.sep:
|
||||
path = drive + path[1:]
|
||||
return path
|
||||
if path[0:1] == os.sep:
|
||||
path = drive + path[1:]
|
||||
return path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue